Is there a way to have the second dataset plot on a separate axis, overlaid on the first plot?
using Plots; gadfly(size=(800,400))
plot(Vector[randn(100)], line = ([:green], :step))
plot!(Vector[randn(100)], line = ([:red], :step))
It is now done by adding a twinx()
argument:
plot(rand(10))
plot!(twinx(),100rand(10))
There is, however, some unintentional axis and label behavior:
Therefore, I suggest adding some additional arguments:
plot(rand(10),label="left",legend=:topleft)
plot!(twinx(),100rand(10),color=:red,xticks=:none,label="right")
There still seems to be an issue correlating all series associated with the subplot at the moment.
If you have multiple series you want to plot and want to add your data incrementally, you can do it like this:
p = plot()
p_twin = twinx(p)
plot!(p,x,y)
plot!(p_twin,x,y_twin)