Where should linkaxes!
go?
#3555
-
Hi there! I found myself making faulty plots several times lately because axes I thought I had linked ended up not being linked. Is there a specific place where set_theme!()
f = Figure()
ax = Axis(
f[1, 1];
xlabel="Energy [eV]",
ylabel="PL [norm.]",
)
ax_abs = Axis(
f[1, 1];
ylabel="Absorption [norm.]",
yaxisposition=:right,
)
linkaxes!(ax, ax_abs)
hidespines!(ax_abs)
energies = range(start=1, stop=3, length=500)
abso = @. exp(-(energies - 2)^2 / (2*0.01)^2)
lines!(ax, energies, abso)
lines!(ax_abs, energies, abso, color=Cycled(2))
f
save("link_before_plotting.png", f) Whereas if I link after plotting: set_theme!()
f = Figure()
ax = Axis(
f[1, 1];
xlabel="Energy [eV]",
ylabel="PL [norm.]",
)
ax_abs = Axis(
f[1, 1];
ylabel="Absorption [norm.]",
yaxisposition=:right,
)
hidespines!(ax_abs)
energies = range(start=1, stop=3, length=500)
abso = @. exp(-(energies - 2)^2 / (2*0.01)^2)
lines!(ax, energies, abso)
lines!(ax_abs, energies, abso, color=Cycled(2))
linkaxes!(ax, ax_abs)
f
save("link_after_plotting.png", f) Is this a bug, or do I misunderstand the goal of |
Beta Was this translation helpful? Give feedback.
Answered by
jkrumbiegel
Jan 16, 2024
Replies: 1 comment 2 replies
-
This must be a bug, linked axes should stay synchronized if you keep plotting stuff. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Klafyvel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This must be a bug, linked axes should stay synchronized if you keep plotting stuff.