I’m having trouble making a plot with labels and ticks on the left and right sides. Perhaps this capability has stopped working? According to this question from a couple years ago, it looks like it was working then. However, that code does not produce the secondary label on the right side for me, using Julia 1.7.1. Looking at the available attributes using plotattr(:Axis) and plotattr(:Plot), I thought maybe tick_direction would help but it didn’t. And the layout attribute looked promising but it appears that is for laying out subplots not labels and ticks. Here’s my code and the resulting plot:
using Plots
pyplot()
function tstplt6()
a = 1:3
b = [1, 2, 7]
plot(a, b,
label = "randData",
xlabel = "numbers",
ylabel = "Rand data",
color = :red,
legend = :topleft,
tick_direction = :in,
grid = :on)
p = twinx()
plot!(p, a, log.(a),
label = "log(x)",
ylabel = "The right Y label",
color = :green,
legend = :topright,
tick_direction = :out,
grid = :on,
box = :on)
savefig("tstplt6.png")
end