Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordering of plot elements with PGFPlotsX #4751

Closed
gdbeck opened this issue May 19, 2023 · 1 comment
Closed

Ordering of plot elements with PGFPlotsX #4751

gdbeck opened this issue May 19, 2023 · 1 comment
Labels
bug PGFPlotsX upstream julia or dependencies

Comments

@gdbeck
Copy link

gdbeck commented May 19, 2023

Details

I'm having trouble controlling the order in which series and lines are rendered using the PGFPlotsX backend. I would like to create a plot where lines appear on top of the symbols. The symbols seem to appear on top of the lines, however, regardless of the order in which the commands are entered.

With GR it seems to work correctly. This produces a plot with the symbols above the lines, as expected,

using Plots

x = 0:pi/8:2*pi
y = sin.(x)

gr()

p1 = plot(x,y)
p1 = scatter!(x,y)

savefig(p1,"symbols_over_lines_gr.png")

symbols_over_lines_gr

and this produces a plot with the lines over the symbols, as expected.

p2 = scatter(x,y)
p2 = plot!(x,y)

savefig(p2,"lines_over_symbols_gr.png")

lines_over_symbols_gr

With PGFPlotsX, however, while this still plots the symbols over the lines, as expected,

pgfplotsx()

p1 = plot(x,y)
p1 = scatter!(x,y)

savefig(p1,"symbols_over_lines_pgfplotsx.png")

symbols_over_lines_pgfplotsx

this also plots the symbols over the lines.

p2 = scatter(x,y)
p2 = plot!(x,y)

savefig(p2,"lines_over_symbols_pgfplotsx.png")

lines_over_symbols_pgfplotsx

Any suggestions? Thanks in advance for any help!

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pythonplot x
plotlyjs x
pgfplotsx x
unicodeplots x
inspectdr x
gaston x

Versions

Plots.jl version: 1.38.8
Backend version (]st -m <backend(s)>): PGFPlotsX 1.5.3
Output of versioninfo(): Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin21.4.0)
CPU: 8 × Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
Threads: 6 on 8 virtual cores

@gdbeck gdbeck added the bug label May 19, 2023
@BeastyBlacksmith BeastyBlacksmith added PGFPlotsX upstream julia or dependencies labels May 22, 2023
@BeastyBlacksmith
Copy link
Member

This is an inherent limitation of pgfplots (cf. pgf-tikz/pgfplots#15 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug PGFPlotsX upstream julia or dependencies
Projects
None yet
Development

No branches or pull requests

2 participants