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

double y axes doesn't work in PGFPlotsX #254

Closed
pstaabp opened this issue Feb 6, 2021 · 4 comments
Closed

double y axes doesn't work in PGFPlotsX #254

pstaabp opened this issue Feb 6, 2021 · 4 comments

Comments

@pstaabp
Copy link

pstaabp commented Feb 6, 2021

I was looking to plot with multiple items with different y-axes. I stumbled across:

using Plots, LaTeXStrings
a = 1:10
b = rand(10)
plot(a,b, label = "randData", ylabel = "Rand data",color = :red, 
    legend = :topleft, grid = :off, xlabel = "numbers")
p = twinx()
plot!(p,a,log.(a), label = L"log(x)", legend = :topright, 
     box = :on, grid = :off, ylabel = "y label 2")

from JuliaPlots/Plots.jl#2636. In GR this works fine (with some spacing issues), but using the PGFPlotsX backend, we get:
image
where both y-axes are on the left and the x-points of the two curves do not overlay.

Although from JuliaPlots/Plots.jl#594, it appears that twinx() is a hidden feature, it seems like there is interest in it.

@tpapp
Copy link
Collaborator

tpapp commented Feb 6, 2021

I think this is an issue with the Plots backend, not this package. @BeastyBlacksmith, can you transfer to the relevant repo?

@pstaabp
Copy link
Author

pstaabp commented Feb 6, 2021

I decided to add it here because it seems to work in the GR backend, so I thought it might be a PGFPlotsX issue instead.

@tpapp
Copy link
Collaborator

tpapp commented Feb 6, 2021

No problem, we really should make an effort to clarify this (cf #255). Given the information above, without delving into the internals of the backend (in Plots.jl) we cannot easily determine if this is a bug with PGFPlotsX per se, or the way the backend is using it.

@KristofferC
Copy link
Owner

Issues with Plots need to be reported to the Plots repo (until they are determined to be a bug with the backend, and in that case need to have an example that is directly using the backend, and not using the Plots wrappers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants