Currently I’m using RCall, to plot in R, but I’m trying to switch to plotting directly in Julia (in Juno IDE, on Linux mint). I’m trying to overlay a plot I made with Plots.jl using the GR backend with a second plot with a differently scaled y-axis on the right side of the picture. The figure I want to produce should look similar to that:
With GR I got as far as the following:
display(plot(1:Generations, Npop, title=titlemain, lw=2, c= :green,
xlabel=“Generations”, ylabel=“Populationsize”, ylims=0:(2*K), leg=false))
This gives me a plot similar to only the green data in the picture.
Now, I want to add a second y axis on the right size and use that to overlay the first (green in the picture) plot with a second line. This is necessary, because the datasets are scaled so differently (up to several 1000 in the first, and 0 - 4 in the second one). Does anybody have an idea how to achieve this? I tried searching the Plots.jl documentation and the GR framework homepage, but I didn’t find info an how to set the side on which the y axis is displayed or how to overlay two plots… I’m really grateful to anybody with an idea!