org-arl/InteractiveViz.jl

Reset axis limits when adding data to plots

Closed this issue · 4 comments

rs7q5 commented

Is there a way to reset axis limits when adding to a plot. In other words, the reset button shows all data.

I'm not sure I understand the question fully. Could you give an example to illustrate what you mean?

rs7q5 commented

So if I have a data set that I plot with iscatter (or any of the functions) and say the x limits are 0 and 10. I then add another set of data using iscatter! and maybe the x limits of that data is -10 to 20 or something that is a larger span than the original data plotted with iscatter. The reset or 0 position are the original axis limits when I used iscatter, but I want the axis limits to show all data. I know in the docs it is mentioned that when you add to a plot the limits will stay the same, but I was wondering if there could be an option to update the x and y limits when adding to a plot.

As a code example though, one could run the two lines below. And so currently the 0 position when you reset the plot is the axis limits of the first plot, but I want them to be large enough to see the data from the data I added.

iplot(1:10)
iplot!(0.5:20)

Yes, shouldn't be hard to add an option to adopt new axis limits. But no such option currently available, so marking this as a feature request during the next release.

This can be done by explicitly calling the xlims!() or ylims!() methods from Makie.