You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
There is no set_linestyle_cycle in the matplotlib axes API #2841
It would be useful to have an API to set the linestyle cycle for an axes object, just like there is one for the color cycle. It would allow one to change linestyles independently of the color, which is useful for publications that need both color and black-and-white distinguishability.
This has long been a wish of mine, and I have tinkered with a more
generalized mechanism for cycling all sorts of properties. Unfortunately, I
ran out of time and resources to really get this working back in the day. I
wanted to cycle not just colors and linesyles, but also markers,
linewidths, hatching (for histograms, for example)... anything really.
The trouble was immediately apparent with how crusty the current color
cycling mechanism is. Internally, there are actually two (or three?) color
cycles, one for scatter and one for line plots. This way, if someone does a
scatter plot, and then does a line plot, under most use-cases, the
"correct" color appears. I think the same thing happens for doing
histograms or bar charts with plot() (so that would be 3 color cycles!).
So, for such a huge scope that I envisioned, one can see how badly that
would turn out...
If I ever have any time at all to work on matplotlib again, it would be this feature that I would refactor so that this could be implemented.
It would be useful to have an API to set the linestyle cycle for an axes
object, just like there is one for the color cycle. It would allow one to
change linestyles independently of the color, which is useful for
publications that need both color and black-and-white distinguishability.
Reply to this email directly or view it on GitHubhttps://github.com//issues/2841
.
I think it is time to stop letting perfection be the enemy of
"good-enough"... it should be fairly trivial to duplicate the color cycle
stuff and use it the same way...
Activity
WeatherGod commentedon Feb 25, 2014
This has long been a wish of mine, and I have tinkered with a more
generalized mechanism for cycling all sorts of properties. Unfortunately, I
ran out of time and resources to really get this working back in the day. I
wanted to cycle not just colors and linesyles, but also markers,
linewidths, hatching (for histograms, for example)... anything really.
The trouble was immediately apparent with how crusty the current color
cycling mechanism is. Internally, there are actually two (or three?) color
cycles, one for scatter and one for line plots. This way, if someone does a
scatter plot, and then does a line plot, under most use-cases, the
"correct" color appears. I think the same thing happens for doing
histograms or bar charts with plot() (so that would be 3 color cycles!).
So, for such a huge scope that I envisioned, one can see how badly that
would turn out...
If I ever have any time at all to work on matplotlib again, it would be
this feature that I would refactor so that this could be implemented.
On Tue, Feb 25, 2014 at 9:50 AM, Ruben Van Boxem
notifications@github.comwrote:
tacaswell commentedon Feb 26, 2014
I thought this would be a quick fix, but given @WeatherGod 's comments, re-milestoning this for 1.5 + wishlist
mrkrd commentedon Nov 12, 2014
That would be a very useful feature. Thank you!
WeatherGod commentedon Nov 19, 2014
Out-of-the-blue thread-rezzin'
I think it is time to stop letting perfection be the enemy of
"good-enough"... it should be fairly trivial to duplicate the color cycle
stuff and use it the same way...
I think I'll pull together a PR for this tonight.
On Wed, Nov 12, 2014 at 2:27 PM, mrkrd notifications@github.com wrote:
Added automated tests for cycle issue matplotlib#2841
Added automated tests for cycle issue matplotlib#2841
TorbjornT commentedon Jan 11, 2016
I guess the new prop_cycler in 1.5 solves this?
tacaswell commentedon Jan 11, 2016
Yes, that was the intention. I think this is safe to close as completed.
Is the minimal example to cycle only the line style.