[Scilab-users] Scaled plot displays in Scilab?

6 messages
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 regardsRafael G. _______________________________________________ users mailing list [hidden email] http://lists.scilab.org/mailman/listinfo/users
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
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. RegardsRafael G. From: users [mailto:[hidden email]] On Behalf Of ?????????Sent: Thursday, January 09, 2014 3:34 PMTo: [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.Stanislav09.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 regardsRafael 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
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 Steerclf;plot(linspace(0,100,10),linspace(0,150,10))fig=gcf();ax=gca();ax.tight_limits="on";//Dimensions of the axis in user coordinatesax_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 mmpy=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 pixelsax_Wp=ax_xp/(1-sum(ax.margins(1:2)));ax_Hp=ax_yp/(1-sum(ax.margins(3:4)));//Canvas dimensions in pixelsfig_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:04Objet: 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. RegardsRafael G. From: users [mailto:[hidden email]] On Behalf Of ?????????Sent: Thursday, January 09, 2014 3:34 PMTo: [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.Stanislav09.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 regardsRafael 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
 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 regardsRafael From: users [mailto:[hidden email]] On Behalf Of Serge SteerSent: Thursday, January 09, 2014 7:46 PMTo: 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 Steerclf;plot(linspace(0,100,10),linspace(0,150,10))fig=gcf();ax=gca();ax.tight_limits="on";//Dimensions of the axis in user coordinatesax_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 mmpy=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 pixelsax_Wp=ax_xp/(1-sum(ax.margins(1:2)));ax_Hp=ax_yp/(1-sum(ax.margins(3:4)));//Canvas dimensions in pixelsfig_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:04Objet: 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. RegardsRafael G. From: users [mailto:[hidden email]] On Behalf Of ?????????Sent: Thursday, January 09, 2014 3:34 PMTo: [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.Stanislav09.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 regardsRafael 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