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 users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
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:users-boun...@lists.scilab.org] On Behalf Of ? Sent: Thursday, January 09, 2014 3:34 PM To: users@lists.scilab.org 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 users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
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]; - Mail original - De: Rafael Guerra jrafaelbgue...@hotmail.com À: International users mailing list for Scilab. users@lists.scilab.org 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:users-boun...@lists.scilab.org] On Behalf Of ? Sent: Thursday, January 09, 2014 3:34 PM To: users@lists.scilab.org 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 users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] 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:users-boun...@lists.scilab.org] 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 jrafaelbgue...@hotmail.com À: International users mailing list for Scilab. users@lists.scilab.org 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:users-boun...@lists.scilab.org] On Behalf Of ? Sent: Thursday, January 09, 2014 3:34 PM To: users@lists.scilab.org 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 users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users