Plots.jl
Plots.jl copied to clipboard
[BUG] Missing segment on custom markers
Hi!
When using a Polygon as a custom marker shape, the last segment closing the polygon is missing.
MWE:
using Plots
polygon = Shape([(-1, -1), (0, 1), (1, -1)])
plot(
plot(polygon),
scatter(1:10, markershape = polygon,
markersize = 25, markerstrokewidth = 2),
aspect_ratio = :equal, legend=false)
This results in:
Cheers,
Backends
This bug occurs on ( insert x
below )
Backend | yes | no | untested |
---|---|---|---|
gr (default) | x | ||
pyplot | x | ||
plotlyjs | x | ||
pgfplotsx | x | ||
unicodeplots | x | ||
inspectdr | x | ||
gaston | x |
Versions
Plots.jl version: v1.31.1
Backend version (]st -m <backend(s)>
):
Output of versioninfo()
:
Julia Version 1.6.2 Commit 1b93d53fc4 (2021-07-14 15:36 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-11.0.1 (ORCJIT, skylake) Environment: JULIA_REVISE_WORKER_ONLY = 1
I think this depends on the default axis limits (considering the location of the data points without taking into account the marker sizes). The markers can be shown completely after defining:
plot!(xlims = (0,11), ylims = (0,11))
I would suggest not to change the default, as the marker sizes can be arbitrary from case to case.
Hi!
This issue has been wrongly interpreted. In the image you have uploaded, it is possible to see that the line at the base of the triangles is missing independent of the plot limits. The marker stroke should also include the base of the triangles, but when using the polygon as a marker, one of the edges is always missing. Can this be re-opened?
Cheers
I see, the explanation of @songhanzhang was focusing on limits.