-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Implicit addition of "color" to property_cycle breaks semantics #6380
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
Trying to address this brought up an other corner case. In the test we do ax.set_prop_cycle(linewidth=[2, 3, 4, 5, 6], facecolor='bgcmy') so if we remove the implicit color I think this is just a wart of how this, as the The other option is to start injecting cyclers into every call to |
On 2016/05/22 5:37 PM, Thomas A Caswell wrote:
I'm not sure I see how this is a problem--do you mean it is because the
Downright unacceptable. |
If the user sets an axes level prop cycle, the CN notation will still refer We could also move some if the color conversion machinery to the axes On Mon, May 23, 2016, 00:04 Eric Firing notifications@github.com wrote:
|
Would it be possible to add a cycler kwarg to |
That seems reasonable to me. attn @anntzer |
Actually I have no idea of what's happening in the "interesting" block of
which I just copy-pasted from the previous implementation... so I'll let someone else take care of it. |
@tacaswell, that block of code looks a little odd: if there is neither a 'axes.prop_cycle' nor a 'axes.color_cycle', |
The rc validation means |
closed by #6499 |
In the 2.x branch, the recent addition of the CN feature also added an implicit assumption that "color" will always be in the property cycle. This conflicts with the feature of prop_cycle that it only advances for a plotting function if the user does not specify at least one of the properties made available by the property cycle.
This is important because several plotting functions will make multiple calls to plot()/fill() under the hood, but should have already advanced the cycle. Also, this mimics pre-1.5 behavior of the color_cycle where it did not advance if color was already specified.
The test (which is currently being modified to paper over the problem) which noticed this change is the following:
In the v1.5.x branch, this would result in the cycler not being advanced for the first three lines, and then two lines are made with linewidths of 2 and 4 in that order. In 2.x branch, the cycler gets advanced because of the implicit inclusion of "color" to the property cycle. Therefore, the cycler has a property which is not specified by the user, and it thinks it needs to advance itself. This results in a plot that has three thin lines and then a line of width 4 and then 2 (because of the odd number of plot calls prior).
Now, consider the following scenario:
In this case, the cycler will not advance for the first three plots, but will for the last two -- as expected. This difference in behavior will cause confusion among users, and will be very difficult to explain.
I shall re-iterate my design concept behind the property-cycle feature that I added for v1.5: "Color is not special!". I am fine with having a failover mechanism for "C0" in the case that color isn't in the cycler, but to actually modify the cycler provided by the user only leads to confusion. What would we do when we want to expand the "CN" notation to other properties? Are we going to start implicitly include them into the property cycle as well?
The text was updated successfully, but these errors were encountered: