You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Passing 'fontsize' to format() has no effect on subplot font #212
I have a plot of two panels, one with projection and one without:
I want to modify the tick label size of both panels. It is possible to modify the font size in panel b (no projection) using tick.labelsize in .proplotrc. But the lat/lon label size in panel a (with projection) cannot be changed accordingly.
I also wonder if there is a more convient way of changing font size in the single format() call, because ax.format(fontsize=20) seems not take any effect.
Hi @miniufo, you're right that fontsize (which represents the rc['font.size'] property) should change the axes font when passed to ax.format(). It is unfortunately sometimes unclear which rc settings can be applied to axes with format(). I'll add this as a feature at some point.
For now you have two options:
Change the default fontsize with e.g. plot.rc['font.size'] = 6. Note this will have an effect on all plot elements, both titles and labels, whose sizes are specified relative to font.size with values like 'small' and 'large'.
Change both the geographic plot and cartesian plot label sizes with axs.format(gridlabelsize=size, ticklabelsize=size) or e.g. plot.rc.update({'grid.labelsize': size, 'tick.labelsize': size}). "Grid labels" correspond to labels of meridian/parallel gridlines, and "tick labels" correspond to labels along cartesian plots ticks.
This is now fixed. The fix was relatively simple, I just have to track which rc settings can have font size-relative values like 'small' and 'large' then update them whenever rc['font.size'] is changed.
Below is an example. Note by default, just like matplotlib, proplot uses font size-relative units for all content -- so passing fontsize=N changes the size of pretty much all text.
Activity
[-]change the fontsize of lat/lon tick labels[/-][+]Passing 'fontsize' to format() has no effect on subplot font[/+]lukelbd commentedon Jun 29, 2021
Hi @miniufo, you're right that
fontsize(which represents therc['font.size']property) should change the axes font when passed toax.format(). It is unfortunately sometimes unclear which rc settings can be applied to axes withformat(). I'll add this as a feature at some point.For now you have two options:
plot.rc['font.size'] = 6. Note this will have an effect on all plot elements, both titles and labels, whose sizes are specified relative tofont.sizewith values like'small'and'large'.axs.format(gridlabelsize=size, ticklabelsize=size)or e.g.plot.rc.update({'grid.labelsize': size, 'tick.labelsize': size}). "Grid labels" correspond to labels of meridian/parallel gridlines, and "tick labels" correspond to labels along cartesian plots ticks.See this page for more info.
lukelbd commentedon Jul 6, 2021
This is now fixed. The fix was relatively simple, I just have to track which rc settings can have font size-relative values like
'small'and'large'then update them wheneverrc['font.size']is changed.Below is an example. Note by default, just like matplotlib, proplot uses font size-relative units for all content -- so passing
fontsize=Nchanges the size of pretty much all text.