[Scilab-users] Zoom in plot

torpedo dcstoyanov at gmail.com
Fri Jul 24 10:43:51 CEST 2020


Hi,
I was looking for a way to have a zoom inside a plot. I didn't find any
example, so I tried to do myself. 
Let me know if there is a better way to do it (for instance, if is it
possible to avoid to repeat the *plot* command)

clf()

// main axes
x = 0:0.1:20;
plot(x, acosh(x),"r", x, asinh(x), "g")
a = gca()
a.axes_bounds = [0, 0, 1, 1];
legend(["acosh", "asinh"], pos = "in_upper_left")
xpoly([0, 0, 2, 2], [0, 1, 1, 0])
xarrows([2, 12], [.5, 1.5], 8)

// zoom axes
z = newaxes();
z.axes_bounds = [.6, .3, .2, .5];
plot(x, acosh(x),'r', x, asinh(x), "g")
zoom_rect(z, [0, 0, 2, 1])

<http://mailinglists.scilab.org/file/t498101/zoom-in-plot.png> 



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html



More information about the users mailing list