-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
WIP: Use color cycle in more places #5584
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
Conversation
@@ -2554,9 +2555,20 @@ def pie(self, x, explode=None, labels=None, colors=None, | |||
raise ValueError("'label' must be of length 'x'") | |||
if len(x) != len(explode): | |||
raise ValueError("'explode' must be of length 'x'") | |||
if colors is None: | |||
if ((colors is None) and | |||
('color' in self._get_patches_for_fill._prop_keys)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent to not line up with codeblock
There is already a test file for testing property cycles, so it would make sense to add the new test there. Also, I am lamenting a bit that this is only utilizing the color portion of the property cycle. I really would like to see more properties used, and the internal.classic_mode trick might be a good way to shim that into more places. Also, could we check that switching from a classic style to a different style doesn't leave that _internal.classic_mode param behind? That would probably cause bugs down the road, I think. |
Unfortunately, the property cycle that makes sense for line plots will not be appropriate for other kinds of plots. I don't think there's any reasonable way to resolve that. We could have separate property cycles for different plot types (not a great solution either).
If a new style is applied over top, it will remain, but if a new style is set it isn't. I think that's probably the correct behavior. |
Right, that is why the current codebase is a bit of a mess in this regard, and it is also partly why the code for handling the munging of properties from the cycler and properties explicitly provided from the user is a bit icky for plot() and bar(). However, the actual function for munging that information is all there in |
Yes, I agree, and I'm sorry I wasn't clear about that -- that's what I'm suggesting we do in #5577. This is really just a proof-of-concept that not doing something like that is a mess. |
Given our discussion about how to expose the current |
Does anyone know why the two |
To prevent further confusion, I'm going to close this issue, since I never meant it as a serious solution -- just an example of where things need to be fixed in a better way. We can keep the discussion going here, though. |
The two instances was so that if bar() was called and then plot(), they On Tue, Dec 1, 2015 at 8:05 AM, Michael Droettboom <notifications@github.com
|
I think (but am not sure why) there are two so that you can do I am not seeing where |
You are probably right, I am working off of memory here. I don't use bar() On Tue, Dec 1, 2015 at 10:09 AM, Thomas A Caswell notifications@github.com
|
This fixes some plot types that were using their own hardcoded color cycle to use the color cycle in the rcParams.
I'm submitting this PR basically to demonstrate the motivation for #5577 which would fix this in a more uniform and less hackish way. Though I'm fine with merging this as-is if we decide that doing #5577 properly is too disruptive right now.