Skip to content
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

There is no set_linestyle_cycle in the matplotlib axes API #2841

Closed
rubenvb opened this issue Feb 25, 2014 · 6 comments
Closed

There is no set_linestyle_cycle in the matplotlib axes API #2841

rubenvb opened this issue Feb 25, 2014 · 6 comments
Milestone

Comments

@rubenvb
Copy link

rubenvb commented Feb 25, 2014

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.

@tacaswell tacaswell added this to the v1.4.0 milestone Feb 25, 2014
@WeatherGod
Copy link
Member

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:

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
.

@tacaswell
Copy link
Member

I thought this would be a quick fix, but given @WeatherGod 's comments, re-milestoning this for 1.5 + wishlist

@tacaswell tacaswell modified the milestones: v1.5.x, v1.4.0 Feb 26, 2014
@mrkrd
Copy link

mrkrd commented Nov 12, 2014

That would be a very useful feature. Thank you!

@WeatherGod
Copy link
Member

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:

That would be a very useful feature. Thank you!


Reply to this email directly or view it on GitHub
#2841 (comment)
.

@TorbjornT
Copy link

I guess the new prop_cycler in 1.5 solves this?

@tacaswell
Copy link
Member

Yes, that was the intention. I think this is safe to close as completed.

ax.set_prop_cycle('ls', ['-', '--', ':'])

Is the minimal example to cycle only the line style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants