Dual y axis appears on the same side in a Pluto notebook with Plots

I’m trying to make a plot with dual y axis using Plots in a Pluto notebook.

begin
plot(randn(100), ylabel="y1", leg=:topright)
plot!(twinx(), randn(100)*10,
    c=:red,
    ylabel="y2",
    leg=:bottomright,
    size=(600, 400))
plot!(right_bottom=10mm)
end

For some reason, the result is that both of them are on the left side, I can’t get it to have one of them on the right:
newplot

What am I missing?

1 Like

1

begin
    plot(randn(100), ylabel="y1", leg=:topright)
    plot!(twinx(), randn(100)*10,
        c=:red,
        ylabel="y2",
        leg=:bottomright,
        size=(600, 400))
    plot!(right_bottom=10Plots.mm)
end

I have chaged mm to Plots.mm, but I guess it’s not the issue. Just restart julia session or upgrade julia version. My result is obtained in julia 1.9.0 and Plots v1.38.11.

I tried this and still, they are both on the same side. I upgraded both Julia and plots too.
Not sure what is causing this, or how I can force it to be on the other side.

I’m facing the same issue with pyplot in Plots.jl. Plots v1.38.17 and Julia v1.9.2.
I think this is unique to pyplot, @PeX are you also using pyplot?
When I switched to GR it worked as expected…

I’m also having the same issue, also using Pluto and Plotly. I’m a semi-beginner with Julia, I can’t just change the backend to GR() and have all my Plotly commands still work correct?