FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

improved dash styles · Issue #5917 · matplotlib/matplotlib · GitHub

improved dash styles #5917

Closed
Closed

Description

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:

(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 :-)

Activity

  1. tacaswell commented on Jan 26, 2016

    Member

    👍 Sorry this got lost.

  2. added this to the milestone on Jan 26, 2016
  3. WeatherGod commented on Jan 26, 2016

    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 <notifications@github.com

    wrote:

    [image: 👍] Sorry this got lost.

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

  4. self-assigned this
    on Jan 26, 2016
  5. mdboom commented on Jan 26, 2016

    Member

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

  6. mdboom commented on Jan 26, 2016

    Member

    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.
  7. njsmith commented on Jan 26, 2016

    Author

    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

  8. njsmith commented on Jan 26, 2016

    Author

    ... 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!

  9. mdboom commented on Jan 26, 2016

    Member

    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.

  10. efiring commented on Jan 26, 2016

    Member

    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.

  11. mdboom commented on Jan 27, 2016

    Member

    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.

  12. added a commit that references this issue on Jan 27, 2016
    04ffd42
  13. added a commit that references this issue on Jan 27, 2016
    cb52bc0
  14. added a commit that references this issue on Feb 8, 2016
    eb2b77b
  15. added a commit that references this issue on Feb 8, 2016
    069785d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL