[Scilab-users] Zoom in plot

Samuel Gougeon sgougeon at free.fr
Fri Jul 24 11:21:56 CEST 2020


Hello,

Le 24/07/2020 à 10:43, torpedo a écrit :
> 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)

Yes, you may use copy(), as it follows.
The legend must be delayed, otherwise it is copied as well, as a member 
of the initial axes:

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];
xpoly([0,  0,  2,  2],  [0,  1,  1,  0])
xarrows([2,  12],  [.5,  1.5],  8)

// zoom axes
z  =  copy(a);
z.axes_bounds  =  [.6,  .3,  .2,  .5];
zoom_rect(z,  [0,  0,  2,  1])

legend(a,  ["acosh",  "asinh"],  pos  =  "in_upper_left")


Regards
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200724/1a044467/attachment.htm>


More information about the users mailing list