Keep the graphic's zoom
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I would like to know how I can keep the zoom of graphic when I will go to change the variable that I'm watching at the moment.
thanks
regards
6 Kommentare
Jan
am 16 Mär. 2011
Please anser my question. Keeping the limits and zooming is a contradiction. Therefore you cannot do both.
Akzeptierte Antwort
Jan
am 14 Mär. 2011
Another approach:
y1 = rand(1, 100);
y2 = rand(1, 200) * 2;
AxesH = axes('NextPlot', 'add');
Plot1H = plot(y1);
pause(2.0);
set(AxesH, 'XLimMode', 'manual', 'YLimMode', 'manual');
Plot2H = plot(y2, 'r');
Or you can replace the XData and YData of the plotted line directly instead of the last line:
set(Plot1H, 'XData', 1:200, 'YData', rand(1, 200));
7 Kommentare
Weitere Antworten (1)
Andrew Newell
am 14 Mär. 2011
If I understand your question, you can do something like the following. Make your first plot, for example
plot(1:10)
Zoom in, and then save the values of axis:
v = axis;
Finally, make your next plot and set the axis values.
plot(3:5)
axis(v)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!