[Matplotlib-users] redefining color keywords in stylesheets

Pierre Haessig pierre.haessig at crans.org
Thu Apr 7 05:03:12 EDT 2016


Thanks for the update !

The ability to use properties 0,1,2 looks very useful. The notation
'[n]' looks a bit heavy, but I guess this is necessary to avoid clashing
with the existing behavior (linewidth=0 vs. linewidth='[0]'...).


As for the palette, I think it's very similar to what I was proposing.
Only putting things in the rcParams is maybe simpler because it is
compatible with the existing stylesheet mechanism. For me, the palette
should just be one aspect of the style.

Things could be as simple as having 'color.b', 'color.g', ... keys added
to rcParams. (or 'palette.b'...)

best,
Pierre

Le 06/04/2016 16:52, Benjamin Root a écrit :
> Pierre,
>
> We are working on a couple different features that would better
> address your problem. First, we are working on implementing a
> shorthand notation for properties that would reference elements in the
> property cycle. So, specifying `color='[0]'` and `linewidth='[0]'`
> would set those properties from the first element of the property
> cycle. There are some details that are still being worked out, though,
> and would likely land in version 2.1, but a preview/beta pared-down
> version might appear in v2.0.
>
> Another feature that has been discussed, but hasn't gotten very far is
> a "palette" concept. This would allow one to have multiple versions of
> that ColorConverter dictionary that would map the names to different
> rgb specs. I don't think this idea has gotten a pull request yet, and
> I would imagine that it shouldn't be too difficult to implement for
> those who might be interested in taking it on.
>
> Cheers!
> Ben Root



More information about the Matplotlib-users mailing list