-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Legend label size not mutable by rcparams #3
Comments
Thanks for the report. I'll look into that legend issue specifically, you should definitely be able to override the settings manually. As for your first issue: in the
The basic idea here is, the user could change a global property (the dictionary keys) to change any of the constituent ("children") properties all at once. This includes the key The problem is, whenever you change a setting in one of these "property families", all the other settings get changed too. Since in your example dictionary, I think I'll disable this behavior, and make the "property syncing" only possible when the user accesses those global keywords Note the |
@lukelbd Thanks for thinking about this. I've always found rcParams to be powerful but inconsistent. The best method for me has been to make my own style file, but then it's sort of a fixed style. I like the |
@lukelbd, I gave the global approach a shot and still 'small' doesn't affect the legend.fontsize feature. It seems like a larger lock on legend mutability for some reason. |
Thanks for finding this. This was indeed a bug; latest push (27ea3dd) should fix it. Two important things in that commit:
This example demos the new (fixed) behavior: import proplot as plot
import numpy as np
plot.nbsetup()
for size in (4,12):
# plot.rc.small = size
plot.rc['legend.fontsize'] = size
f, ax = plot.subplots()
for i in range(6):
ax.plot(np.random.rand(10), label=f'line {i}')
ax.legend() |
Great, thanks for that fix! This should work fine for now. Two other oddities to point your attention to:
import proplot as plot
import numpy as np
plot.nbsetup()
x = np.random.rand(100,)
f, ax = plot.subplots(nrows=2, axwidth=6, aspect=5)
ax[0].plot(x, label='data')
ax[0].legend()
ax.format(rc_kw={'small': 14})
ax[1].plot(x, label='data')
ax[1].legend()
|
No problem! On the first point: Yep, you're right. The On the second point: That is another bug. I had been applying properties by iterating through the text objects generated by |
Fixed it on my end! Thanks. Will keep you posted on other issues; doing plenty of plotting lately so giving you some rigorous testing. |
Calling ax.format(rc_kw={'legend.fontsize': int}) does not affect the font size of labels within the legend, and in fact overrides 'axes.labelsize', affecting the size of tick labels. However, other rcparams for the legend (e.g., legend.handlelength) do work. Because of this, I anticipate this is a
proplot
issue and not amatplotlib
issue.Sample code:
Note that 'legend.fontsize' doesn't affect the font size of labels within the legend, but actually blows up the tick labels to huge sizes. However, 'legend.handlelength' will stretch out the handle graphics.
Also, something internal to
proplot
blocks outside calls from managing this, e.g.:The text was updated successfully, but these errors were encountered: