[Scilab-users] RE(2): Scaled plot displays in Scilab?

Rafael Guerra jrafaelbguerra at hotmail.com
Fri Jan 10 15:39:15 CET 2014


Hello Samuel,

 

Thanks for the excellent "auto_resize off" tip and the great help you give
to the Scilab community (idem for Serge Steer and some other contributors).

 

We are now close to the solution.... but still have a crash problem for
larger plot windows, despite the scroll bar is now included.

Please run the code below with scale = 1/200 and then with scale=1/20, and
let us know if your Scilab crashes too for scale= 1/20 (either immediately
or when trying to slide the scroll bar).

 

 

// Code adapted from Serge Steer's script:

clf;

plot(linspace(0,100,10),linspace(0,150,10))

 

fig= gcf();

ax= gca();

ax.tight_limits= "on";

 

//Dimensions of the axis in user coordinates

ax_xu= ax.data_bounds(2,1)-ax.data_bounds(1,1);

ax_yu= ax.data_bounds(2,2)-ax.data_bounds(1,2);

 

//pixel size in mm to be determined according to screen size and resolution
(dpi)

dpi= 90; // dots per inch (depending on screen resolution)

px= 2.54e-2/dpi;//conversion from pixel to meter

//py= 2.54e-2/dpi;//conversion from pixel to meter

printf("\nSetting scale=1/200 is fine but scale=1/20 crashes Scilab 5.4.1 in
Win 7\n");

scale= input("ENTER scale = ");

// scale= 1/200;  // OK

// scale= 1/20;   // Scilab aborts (Win 7) as window is larger than screen!

 

//Dimension of the axis in pixels 

ax_xp= ax_xu/px*scale;

//ax_yp= ax_yu/py;

 

//Dimension of the current portion of the canvas in pixels

ax_Wp= ax_xp/(1-sum(ax.margins(1:2)));

//ax_Hp= ax_yp/(1-sum(ax.margins(3:4)));

 

//Canvas dimensions in pixels

fig_Wp= ax_Wp/ax.axes_bounds(3);

//fig_Hp=ax_Hp/ax.axes_bounds(4);

fig_Hp=ax_yu;

 

// Samuel Gougeon's tip:

fig.auto_resize = "off";

 

//Set fig.axes_size property to have 

fig.axes_size=[fig_Wp,fig_Hp];

 

 

Kind regards

Rafael G.

 

From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of Samuel
Gougeon
Sent: Friday, January 10, 2014 1:25 PM
To: International users mailing list for Scilab.
Subject: Re: [Scilab-users] Scaled plot displays in Scilab?

 

Le 09/01/2014 22:54, Rafael Guerra a écrit :

.../... 

It would be very useful to be able to display a scaled plot with scrolling
bars, to be able to browse the plot details.

Just do:
fig.auto_resize = "off";

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140110/7409b024/attachment.htm>


More information about the users mailing list