-
Notifications
You must be signed in to change notification settings - Fork 65
improve linestyles, add "-.-." and (:dash, :loose) variants #593
Conversation
ah also as a side note, you can leave out the |
Now, it is more flexible. Not sure if part of this would better fit in PlotUtils or so?
|
This is ready from my side. CairoMakie works without changes. I am looking forward to your review. |
tests pass again :-) |
nice, I think this is good to go then. What do you think @SimonDanisch |
it's technically breaking because it messes up patterns in GLMakie. Compat in GLMakie should only be bumped after the companion PR is merged there. |
I don't quite understand why glmakie's behavior is different in the first place, doesn't the abstractplotting api specify someplace that we're using linewidth-dependent dash sizes? so that's what glmakie should have done anyway. |
I'm pretty sure GLMakie was intended to have linewidth scaled patterns... Not sure what's going on there, it's some pretty gnarly code. |
you are right. I was wrong. That's GLMakie before this PR. [image deleted] So, what this PR does is changing the patterns in GLMakie. So, the dashing is more stretched. EDIT: staring longer at this, I am not sure if the dashes are perfectly scaled. new picture: both are dashed, but one looks more like dotted with large linewidth.
|
So GLMakie actually doesn't need to change? |
How is CairoMakie compared to that? It looks large |
As you wish. The open PR makes the looks more consistent. I'll post a picture in a sec. |
Yeah I saw that you added a scaling factor there, but it's not good practice to add scaling factors by eye-balling :) There should be a correct version no? But as the AbstractPlotting side seems correct to me, I'd argue that GLMakie is buggy and adding this PR here is not breaking in that sense |
I agree, see my comment: JuliaPlots/GLMakie.jl#157 (comment) EDIT: I saw now that my comment over there missed some words to make sense. Now fixed, sorry. |
What does look more correct to you? If you mean the dash length, that's a matter of taste. The CairoMakie output approximately matches the pre-PR state of GLMakie. |
I don't think GLMakie is better, the dash pattern should be 3 times the linewidth, that is what you see in the CairoMakie example. In the glmakie the small dashes are much too long I'd say, and the big dashes less so but still. But overall I think GLMakie is not so bad that we can't merge this and fix it more comprehensively later? |
Ah I see.. The pattern looked visually more similar, but yeah you're right. |
@SimonDanisch compare tikZ line styles as given here: MakieOrg/Makie.jl#807 (comment) |
Looking at this again, I think the multipliers we have here just don't look that good, even if cairomakie displays them correctly. In the tikz example the 3pt that we've translated into 3x multiplier is not a multiplier, and 3x is actually quite short for a dash as we can see above. So we should look at changing those multipliers to something more visually pleasing I guess? We should still stick to multipliers, as that makes conceptually more sense |
In my opinion, they look visually pleasing for linewidth > 2. Also linewidth = 2 looks nicer than linewidth = 1. Here some patterns with linewidth = 2. I would rather make the default linewidth == 2. see also the plot in #593 (comment) where linewidth was 2 as well (probably @jkrumbiegel didn't realize and that's why he didn't complain before ;-)) |
huh yeah that looks better, maybe for small linewidths the fixed gaps actually look better, and only once the linewidth gets large enough it starts looking cramped. well I guess it's ok then :) we can also just go with it for a while and if people complain too much we make adjustments |
This improves CairoMakie. Adjusting the other two backends is still todo.
Before:
After:
fixes MakieOrg/Makie.jl#807