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

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

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

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:[hidden email]] 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


_______________________________________________
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 10/01/2014 15:39, Rafael Guerra a écrit :

.../...
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).

Many Java exceptions are thrown in  the consolebox (-->consolbox on).
They are likely due to unsufficient memory for the Java heap.
To be confirmed.

Samuel


_______________________________________________
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 10/01/2014 20:35, Samuel Gougeon a écrit :
Many Java exceptions are thrown in  the consolebox (-->consolbox on).
--> consolebox on    // with a e
will better work ;) Sorry for the typo


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

Re: RE(2): Scaled plot displays in Scilab?

In reply to this post by Rafael Guerra
Hello.
I use GNU/Linux. This code crashes not only Scilab but whole session of my operating system. I use RFRemix-18, 64-bit, KDE.

Stanislav

10.01.2014 20:39, Rafael Guerra пишет:

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 [[hidden email]] 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



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


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

[Scilab-users] higher resolution

In reply to this post by Rafael Guerra
Hello. I am writing a textbook and trying to create some of the needed plots in Scilab. Is it possible to increase the resolution from the default?

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

Re: higher resolution

On 25/01/2014 20:12, Ryan M. Castle wrote:
> Hello. I am writing a textbook and trying to create some of the needed plots in Scilab. Is it possible to increase the resolution from the default?
>
> TIA  
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
have you tried exporting the plots in a vectorial format?

you can use driver or xs2pdf, xs2eps and other functions.

You can also resize your plots before exporting them in png.

Hope this helps

-- Adrien Vogt-Schilb PhD Student (Cired)
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Claus Futtrup Claus Futtrup
Reply | Threaded
Open this post in threaded view
|

Re: higher resolution

In reply to this post by Ryan M. Castle
Hi Ryan

I have successfully created graphics in Scilab, saved as SVG, edited
with InkScape (which is an SVG Editor).

/Claus

On 1/25/2014 20:12, Ryan M. Castle wrote:
> Hello. I am writing a textbook and trying to create some of the needed plots in Scilab. Is it possible to increase the resolution from the default?
>
> TIA  
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
> .
>


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

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

Re: higher resolution

Thanks to you and Adrien for the tips.

RMC


----------------------------------------

> Date: Sun, 26 Jan 2014 07:55:18 +0100
> From: [hidden email]
> To: [hidden email]
> Subject: Re: [Scilab-users] higher resolution
>
> Hi Ryan
>
> I have successfully created graphics in Scilab, saved as SVG, edited
> with InkScape (which is an SVG Editor).
>
> /Claus
>
> On 1/25/2014 20:12, Ryan M. Castle wrote:
>> Hello. I am writing a textbook and trying to create some of the needed plots in Scilab. Is it possible to increase the resolution from the default?
>>
>> TIA
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>> .
>>
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus protection is active.
> http://www.avast.com
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users     
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users