-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Improve linestyles (including a fix for broken line styles in CairoMakie) #807
Improve linestyles (including a fix for broken line styles in CairoMakie) #807
Comments
really cool summary, thanks! I think we should try to mirror existing packages' handling of dashes. I just remember that I fixed the GLMakie vs CairoMakie discrepancy of relative / absolute with the |
Are there any objections to using the tikz pattern definitions that I posted above, with |
To me the pyplot behavior seems much more desirable, because what the user means by "dashed" is not a specific gap width in pt but the look of dashes, no matter the line width. So the compromise could be to make the preset values linewidth-relative, but not the manually given ones such as [1, 3, 1, 3]. Or we make everything linewidth-relative, which I like more I think. No matter which format, we should definitely adjust the patterns so they look like the examples you showed from other packages. |
Please have a look at the two open PRs. I can make a follow-up PR for WGLMakie once the other two PRs are approved by you. |
Bug: Lines in CairoMakie
This shows dot, dashdot and dash.
This is because the length of the dashes
https://github.com/JuliaPlots/AbstractPlotting.jl/blob/d78a16de02b73d3548942d43e6664cf0dfa54a5d/src/conversions.jl#L684
is in multiples of line width in CairoMakie.
https://github.com/JuliaPlots/CairoMakie.jl/blob/b0121ad11ab77eb79544942788c341972d31a53c/src/primitives.jl#L49
Compare GLMakie
This shows dot, dashdot and dash.
Proposal 1
So, what we could do is, to multiply with
3 * linewidth
in CairoMakie.Proposal 2
But while we're at it, we could also imporve line styles.
dashdot
doesn't really match what know from other packages. (the gap to both sides of the dot should be equal).We could probably model linestyles after tikz.
where the patterns are given by
Source: https://tex.stackexchange.com/questions/45275/tikz-get-values-for-predefined-dash-patterns
Your Feedback needed
Now that I've figured all this out, it would be quite simple to prepare a PR if this is wanted.
The question is, if we want everything as multiples of linewidth, or not. Right now, there is an inconsistency across backends. (I would use the patterns above with
1pt == \pgflinewidth == linewidth
)The text was updated successfully, but these errors were encountered: