-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Special color names to pull colors from the currently active color cycle #5489
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
Two problems: 1) cyclers are not indexable and not easily inspectable. That
|
Yes -- I agree with all that. But I still think the utility of this is too great not to find a way to make work. The motivation is this: It's very common to see people plot a line, then some markers, then some bars all with the same color because that data is somehow "related". Right now, that's really easy because many use the single character color names (r, etc.). When we move to a default style that has more "complex" colors that don't map to the single character color names, it would be desirable to still support a way to do that. The only other way I can think of is if we start requiring that the user explicitly step the property cycle. But I don't think that's going to fly. |
Counter-proposal: What if we made this example: On Mon, Nov 16, 2015 at 9:40 PM, Michael Droettboom <
|
@WeatherGod: That's an interesting proposal. Particularly because it keeps the whole cycler (not just its color aspect) in play. I am worried about overriding label. What if the |
Personally, I would like to avoid adding new notations to plot(). On Tue, Nov 17, 2015 at 9:50 AM, Michael Droettboom <
|
A surprising number plotting methods do accept a There is a stand-alone function which parses the fmt string into a tuple, it would be easy enough to convert that into a function returns a dict which we can then throw into the vapor-ware kwargs normalization and have every function take a |
@WeatherGod I don't think your proposal entirely addresses the basic use case: a user, not a programmer--and maybe a relatively new user, or an occasional user--just wants to be able to get a known consistent color with the fewest characters possible, in a way that is as easy to remember as possible. It might be in a plot command, it might be something else. Old style: 'b', 'g', 'r', etc. New style: the user wants the first or second or third color in the default cycle, because these colors are familiar and they look nice. It has to be easy, repeatable, easy to remember, and not require any fiddling with cyclers, dicts, etc. Just a simple, short string. It should be usable anywhere a colorspec is accepted, as well as in the hard-to-parse-but-convenient 'bo' style plot specification. |
my proposal does not require any fiddling with cyclers for the users. It
What could be easier than that? Still not crazy about the call signature handling, as we have seen how On Tue, Nov 17, 2015 at 5:04 PM, Eric Firing notifications@github.com
|
On 2015/11/17 12:16 PM, Benjamin Root wrote:
This doesn't address my use cases. The user wants a specific color, |
Tying into the labels also means that the color lookup is now axes dependent, where as the |
If you want a specific color, then specify that you want that color. The As for it being tied to an axes, that is an implementation detail that
|
Nothing needs to be added to Cycler; the |
It would be extremely convenient to be able to choose colors from the current color cycle in the special syntax we support as a third argument to
plt.plot
. We proposed using[n]
for this, wheren
is the index into the current color cycle. Eg.:The text was updated successfully, but these errors were encountered: