[Scilab-users] Scaled plot displays in Scilab?

classic Classic list List threaded Threaded
6 messages Options
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Scaled plot displays in Scilab?

Hello,

 

Does anyone know if it possible to generate scaled plots in Scilab?

Say one wants to plot y=f(x), with x being a distance, at 1:1000 scale (i.e., 1 cm on the PC screen would correspond to 10 m along x-variable). Scroll bar may be needed, if for given scale plot is larger than physical screen.

 

Thanks for any hints.

 

Best regards

Rafael G.

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Stanislav Stanislav
Reply | Threaded
Open this post in threaded view
|

Re: Scaled plot displays in Scilab?

Hello.
You may divide x-axis by 1000. For example: plot2d(x ./ 1000, y);
Also you may use a logarithm scale of x-axis.

Stanislav
09.01.2014 21:14, Rafael Guerra пишет:

Hello,

 

Does anyone know if it possible to generate scaled plots in Scilab?

Say one wants to plot y=f(x), with x being a distance, at 1:1000 scale (i.e., 1 cm on the PC screen would correspond to 10 m along x-variable). Scroll bar may be needed, if for given scale plot is larger than physical screen.

 

Thanks for any hints.

 

Best regards

Rafael G.

 



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Scaled plot displays in Scilab?

Hi Stanislav,

 

Thanks but it does not guarantee that the interval [x0,x0+10] will be plotted over 1 cm of the screen...

I think that one may have to use a function like xchange but, more info about the physical screen is still required.

 

Regards

Rafael G.

 

From: users [mailto:[hidden email]] On Behalf Of ?????????
Sent: Thursday, January 09, 2014 3:34 PM
To: [hidden email]
Subject: Re: [Scilab-users] Scaled plot displays in Scilab?

 

Hello.
You may divide x-axis by 1000. For example: plot2d(x ./ 1000, y);
Also you may use a logarithm scale of x-axis.

Stanislav
09.01.2014 21:14, Rafael Guerra пишет:

Hello,

 

Does anyone know if it possible to generate scaled plots in Scilab?

Say one wants to plot y=f(x), with x being a distance, at 1:1000 scale (i.e., 1 cm on the PC screen would correspond to 10 m along x-variable). Scroll bar may be needed, if for given scale plot is larger than physical screen.

 

Thanks for any hints.

 

Best regards

Rafael G.

 




_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Serge Steer-3 Serge Steer-3
Reply | Threaded
Open this post in threaded view
|

Re: Scaled plot displays in Scilab?

You can proceed as follow. Note however that at least under windows it is not possible to create a window larger than the screen.
Serge Steer

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
px=0.33;//conversion pixel to mm
py=0.35;//conversion pixel to mm
//Dimension of the axis in pixels
ax_xp=ax_xu/px;
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);
//Set fig.axes_size property to have
fig.axes_size=[fig_Wp,fig_Hp];


De: "Rafael Guerra" <[hidden email]>
À: "International users mailing list for Scilab." <[hidden email]>
Envoyé: Jeudi 9 Janvier 2014 16:46:04
Objet: Re: [Scilab-users] Scaled plot displays in Scilab?

Hi Stanislav,

 

Thanks but it does not guarantee that the interval [x0,x0+10] will be plotted over 1 cm of the screen...

I think that one may have to use a function like xchange but, more info about the physical screen is still required.

 

Regards

Rafael G.

 

From: users [mailto:[hidden email]] On Behalf Of ?????????
Sent: Thursday, January 09, 2014 3:34 PM
To: [hidden email]
Subject: Re: [Scilab-users] Scaled plot displays in Scilab?

 

Hello.
You may divide x-axis by 1000. For example: plot2d(x ./ 1000, y);
Also you may use a logarithm scale of x-axis.

Stanislav
09.01.2014 21:14, Rafael Guerra пишет:

Hello,

 

Does anyone know if it possible to generate scaled plots in Scilab?

Say one wants to plot y=f(x), with x being a distance, at 1:1000 scale (i.e., 1 cm on the PC screen would correspond to 10 m along x-variable). Scroll bar may be needed, if for given scale plot is larger than physical screen.

 

Thanks for any hints.

 

Best regards

Rafael G.

 




_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Scaled plot displays in Scilab?

Serge,

 

Thank you for the solution provided.

It does the scaling job but the window size is limited to the screen size (whenever the scaled Window is bigger than the screen, my Scilab 5.4.1 on Win 7 crashes abruptly).

 

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

 

Best regards

Rafael

 

From: users [mailto:[hidden email]] On Behalf Of Serge Steer
Sent: Thursday, January 09, 2014 7:46 PM
To: International users mailing list for Scilab.
Subject: Re: [Scilab-users] Scaled plot displays in Scilab?

 

You can proceed as follow. Note however that at least under windows it is not possible to create a window larger than the screen.
Serge Steer

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
px=0.33;//conversion pixel to mm
py=0.35;//conversion pixel to mm
//Dimension of the axis in pixels
ax_xp=ax_xu/px;
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);
//Set fig.axes_size property to have
fig.axes_size=[fig_Wp,fig_Hp];


De: "Rafael Guerra" <[hidden email]>
À: "International users mailing list for Scilab." <[hidden email]>
Envoyé: Jeudi 9 Janvier 2014 16:46:04
Objet: Re: [Scilab-users] Scaled plot displays in Scilab?

Hi Stanislav,

 

Thanks but it does not guarantee that the interval [x0,x0+10] will be plotted over 1 cm of the screen...

I think that one may have to use a function like xchange but, more info about the physical screen is still required.

 

Regards

Rafael G.

 

From: users [mailto:[hidden email]] On Behalf Of ?????????
Sent: Thursday, January 09, 2014 3:34 PM
To: [hidden email]
Subject: Re: [Scilab-users] Scaled plot displays in Scilab?

 

Hello.
You may divide x-axis by 1000. For example: plot2d(x ./ 1000, y);
Also you may use a logarithm scale of x-axis.

Stanislav
09.01.2014 21:14, Rafael Guerra пишет:

Hello,

 

Does anyone know if it possible to generate scaled plots in Scilab?

Say one wants to plot y=f(x), with x being a distance, at 1:1000 scale (i.e., 1 cm on the PC screen would correspond to 10 m along x-variable). Scroll bar may be needed, if for given scale plot is larger than physical screen.

 

Thanks for any hints.

 

Best regards

Rafael G.

 



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: 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


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users