Hi, I’m using the twinx () command, is there a way to have both labels in the same legend?
using Plots
x12=randn(10)
y12=1000*randn(10)
plot(x12, label="x12")
plot!(twinx(), y12, c=:red, legend=:bottomleft, label="y12")
Hi, I’m using the twinx () command, is there a way to have both labels in the same legend?
using Plots
x12=randn(10)
y12=1000*randn(10)
plot(x12, label="x12")
plot!(twinx(), y12, c=:red, legend=:bottomleft, label="y12")
A possible workaround:
using Measures, Plots; gr()
x12=randn(10)
y12=1000*randn(10)
lcx =:blue; lwx=2
lcy =:red; lwy=3
plot([x12[1]], lc=lcy, lw=lwy, label="y12", right_margin=15mm)
plot!(x12, label="x12", lc=lcx, lw=lwx, legend=:topleft)
plot!(twinx(), y12, lc=lcy, lw=lwy, label="")