Open pzabka opened 1 month ago
The gap at r = 0 happens because by default PolarAxis removes points with negative radius. You can turn that off by setting clip_r = false
.
The gap at r = 1 happens because the range doesn't include 2pi. With clip_r = false
you end up drawing the circle twice you won't see the missing r = 1 section anymore.
Should we clamp r
to zero instead of clipping by default? Seems like that would be less surprising.
I'm wondering why r = 0
is a negative radius
It's not https://github.com/MakieOrg/Makie.jl/blob/d57e9d3f5f376dbe52b9d6a0f0c000dcb734a0d8/src/layouting/transformation.jl#L477-L479 It's just that the next point in the line is at a negative radius.
I think regardless of what we do by default it's going to have some downsides.
r = max(0, r)
modifies user datar < 0
shows data that in some contexts is invalid and it may not be intuitive where that data ends upRelated: https://github.com/MakieOrg/Makie.jl/pull/3381 https://github.com/MakieOrg/Makie.jl/issues/3375
Thank you for a great explanation.
Out of curiosity, I have tried Plots.jl and Matlab and in both cases the default behaviour is radius_at_origin=0, clip_r = false
However, I agree that such a result is quite misleading, and the current Makie behaviour feels better. It is just confusing that the line is not going to r=0, leaving the plot area.
When creating lines in PolarAxis, some line segments (around r=0 or theta=2pi) are missing.
MWE:
It should be a full circle, but I got this instead:
When changing the parametr k, the effect may vary.
Tested with: GLMakie v0.10.0 (Makie v0.21.0, Makiecore v0.8.0) CairoMakie v0.12.0 (Makie v0.21.0, Makiecore v0.8.0) GLMakie v0.9.10 (Makie v0.20.9, MakieCore v0.7.3) CairoMakie v0.11.10 (Makie v0.20.9, MakieCore v0.7.3)