Thanks to visit codestin.com
Credit goes to github.com

Skip to content

improved dash styles #5917

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

Closed
njsmith opened this issue Jan 26, 2016 · 9 comments
Closed

improved dash styles #5917

njsmith opened this issue Jan 26, 2016 · 9 comments
Assignees
Milestone

Comments

@njsmith
Copy link

njsmith commented Jan 26, 2016

Reviewing the changes in #5774, I realized that one of the original proposals from the BoF, of fixing up the dash styles to be less terrible, got lost somewhere along the way. IMO the current non-solid dash styles are pretty much unusable. Each on its own might be okay, but when you use them on the same plot (and isn't the whole point of these that you put them on the same plot to make it easier to tell lines apart?), then they have wildly varying visual weights and the dotted style in particular is almost invisible. (This is similar to the problem with the old color cycle, where some colors high much higher contrast than others; fixing that required switching to a set of isoluminant colors. Similarly, we should make the dash style closer to isoluminant.)

Here's a quick mock-up of a better set of dash styles. Left is #5774; right is #5774 + better dash styles:

dashes-color-2

dashes-black-and-white-2

(Code: https://gist.github.com/njsmith/ad4958cd1eb674fbed67)

The reason this is an issue rather than a pull request is that it looks like currently the dash styles are hard-coded constants in GraphicsContextBase and can't be touched by the RC system, and I'm not familiar enough with the life-cycle of GraphicsContext objects and their interaction with the RC system to fix this without some hints. Happy to make a PR if someone points me in the right direction :-)

@tacaswell
Copy link
Member

👍 Sorry this got lost.

@tacaswell tacaswell added this to the 2.0 (style change major release) milestone Jan 26, 2016
@WeatherGod
Copy link
Member

Wow, I do like these a lot better than the current ones. I also remember a
discussion about making the strokes and spaces proportional to the line
width. Any thoughts on that?

On Tue, Jan 26, 2016 at 10:36 AM, Thomas A Caswell <[email protected]

wrote:

[image: 👍] Sorry this got lost.


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

@mdboom mdboom self-assigned this Jan 26, 2016
@mdboom
Copy link
Member

mdboom commented Jan 26, 2016

👍 from me as well. I'll probably throw an implementation of this (based on the numbers in @njsmith's gist) on the #5774 pile.

@mdboom
Copy link
Member

mdboom commented Jan 26, 2016

As for implementation, @njsmith is right about things being too hard-coded at present. I see at least two ways forward:

  1. Add an rcParam that is a dictionary from line style short names to numbers. This seems like the most flexible option, but could create some confusion between adding line styles to the prop_cycle and just the linestyle-name mapping. (This isn't really more-than-one-way-to-do-it -- it's very different things, but it could be a bit obscure/confusing to outsiders).
  2. Use different numbers based on the _internal.classic_mode rcParam. Less confusing, but not as flexible.

@njsmith
Copy link
Author

njsmith commented Jan 26, 2016

Making the stroke units be proportional to the line width is probably a good idea, but I guess more work and could be done as a separate step later?

I guess I should point out that I haven't done any research on how other systems handle dash styles. Even a quick attempt is a big improvement though :-)

On a side note. I know it's been a long road and a lot of effort, but I am really surprised how much better things look in #5774 compared to 1.5. Even

@njsmith
Copy link
Author

njsmith commented Jan 26, 2016

... this trivial plot has what, at least for different substantial style improvements? 2.0 is going to rock :-) thanks for all the work you put in making it real!

@mdboom
Copy link
Member

mdboom commented Jan 26, 2016

Thanks for the reminder about dash styles being proportional to width. That's something I've been meaning to fix for a long time. I think we can tie that behavior to our special backward compatibility flag (_internal.classic). I think we should definitely do that while we're at it.

@efiring
Copy link
Member

efiring commented Jan 26, 2016

Regarding using width as the unit for dash length: you might need to have some minimum value. I suspect that strict scaling would not work well for very thin lines.

@mdboom
Copy link
Member

mdboom commented Jan 27, 2016

Regarding using width as the unit for dash length: you might need to have some minimum value. I suspect that strict scaling would not work well for very thin lines.

That's a good point. Some sort of function from linewidth to dash length will likely need to be applied.

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

6 participants