-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
prop_cycle breaks keyword aliases #6343
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
Comments
At first, I was thinking this was a duplicate of #5875 (which is fixed in master), but I see that this is different. The problem here is that ax.plot() probably isn't properly normalizing all of the various keyword arguments, and as such doesn't detect that the cycler and the keyword property are colliding. The |
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/cbook.py#L2449 but we need to use it places now. |
Sorry... my parser couldn't grok that sentence. |
I mean we have the function available to use, but we need to actually use it in |
Ah. Yeah, I started looking into that, and I am not entirely sure it is ready for prime-time. At least, we don't really have the supporting data for it. One of the big problems I see is that it requires me to know what other keyword arguments will be allowed that don't go through the aliasing mechanism. Perhaps it makes sense to break this function out into three levels. The first level simply does normalization (like I do in the validation step of prop_cycle), and the second level does precedence handling (conflict resolution), and the third level does the "required"/"allowed" handling? |
the |
I created #6345 that should address this problem. Note that v1.5.x will still have a problem if your manually created property cycle uses aliased property names, but that is fixed in 2.x as I noted earlier. |
This seems to solve the problem properly so I closed the issue. Thanks for the quick response! |
Debian GNU/Linux 6.0.10 (squeeze) and OSX 10.11.4, Python 3.5.1, matplotlib 1.5.1 (anaconda 4.0.5)
Setting the prop_cycle for an axis breaks the usage of keyword aliases in the plot function. In the following snippets the keyword
lw=0.1
is ignored, butlinewidth=0.1
produces the wanted result.Maybe it is worth mentioning that
color
is still accessible via its aliasc
after setting a prop_cycle.If it seems weird to set the prop_cycle to just ignore it: I stumbled across this problem while playing around with stylesheets to set a default cycle through different linestyles. But sometimes you want to explicitly change this behaviour.
The text was updated successfully, but these errors were encountered: