PyPlot label_position Y-axis in Julia



I basically want the Y label (using PyPlot) on the right side with it’s ticks. For Python I found the comand ax.yaxis.set_label_position("right") .

But if I do


or ax[:yaxis](label_position="right")

Julia says “type PyObject has no field yaxis” for the first case and “TypeError(”‘YAxis’ object is not callable",)" for the second case. How do I adress it correctly?


I haven’t used PyPlot other than through Plots.jl in a long time, but this seems to work:

using PyPlot
ax = gca()
ax[:yaxis][:label_position] # Returns "right"

For reference, if you wanted to do it in Plots.jl instead you could do:

using Plots
pyplot() # If you insist on the PyPlot backend

plot(rand(100), ymirror = true)