How to make `plot!(...)` without changing `xlimit` and `ylimit`

I have created a plot using Plots.jl and the plot() command. How do I add another thing to the plot using plot!(), without changing the x and y limits?

(I have an application where the first plot command sets good limits, which I don’t know directly myself, and I want to use those for the remaining of the plot)

julia> plot(1:10)  # Initial plot spans 0..10 in both x and y

julia> plot!(xlim=xlims(), ylim=ylims())  # Freeze axis limits

julia> plot!(1:20) # Plot is updated with additional data but within the original axis limits
2 Likes

It worked, thanks a lot!

1 Like