[Scilab-users] figure_size

classic Classic list List threaded Threaded
12 messages Options
Claus Futtrup Claus Futtrup
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] figure_size

Hi there

When I create a new figure, I do newfig = scf();

Then to make the figure larger I do newfig.figure_size = [931,750]; // default is 626 x 587

// When height = 750 is specified, then it correctly becomes 817.

// I have no idea why. Scilab is a bit weird.

The top left corner stays the same, so the figure scales down. (Kinda smart, so you can always get hold of the top bar of the window), but unfortunately my PC monitor is not so large, the figure expand beyond the bottom of the screen.

Is there a way in which I can call scf() with the desired figure size already preset? ... something like scf(figure._size = [931,750]); maybe ?

Best regards,

Claus



_______________________________________________
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: figure_size

Hi all

I figured it out. At the beginning of the script I can call gdf and set parameters. I did:

if saveplots then // if plots are to be saved to disk, then
    plotsize = [931,750]; // make larger plot, default is 626 x 587
    p = gdf(); // Get Default Figure (p = PLOT) settings
    p.figure_position = [80,20]; // default is 200 x 200
//    p.figure_size = [931,750];
end
... The (default) figure_size didn't work, so it's commented out, and so I continue to reset the plot size for each plot individually.

Is this a Scilab bug, or is it my scripting being weird (again) ??

Best regards,
Claus

On 10-09-2017 13:35, Claus Futtrup wrote:

Hi there

When I create a new figure, I do newfig = scf();

Then to make the figure larger I do newfig.figure_size = [931,750]; // default is 626 x 587

// When height = 750 is specified, then it correctly becomes 817.

// I have no idea why. Scilab is a bit weird.

The top left corner stays the same, so the figure scales down. (Kinda smart, so you can always get hold of the top bar of the window), but unfortunately my PC monitor is not so large, the figure expand beyond the bottom of the screen.

Is there a way in which I can call scf() with the desired figure size already preset? ... something like scf(figure._size = [931,750]); maybe ?

Best regards,

Claus




_______________________________________________
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: figure_size

Hi Claus,

 

You probably also need to set:

 

p.auto_resize="off";

 

before  p.figure_size’; otherwise it  may not stick.

 

Regards,

Rafael

 

 

From: users [mailto:[hidden email]] On Behalf Of Claus Futtrup
Sent: Sunday, September 10, 2017 2:03 PM
To: International users mailing list for Scilab. <[hidden email]>
Subject: Re: [Scilab-users] figure_size

 

Hi all

I figured it out. At the beginning of the script I can call gdf and set parameters. I did:

if saveplots then // if plots are to be saved to disk, then
    plotsize = [931,750]; // make larger plot, default is 626 x 587
    p = gdf(); // Get Default Figure (p = PLOT) settings
    p.figure_position = [80,20]; // default is 200 x 200
//    p.figure_size = [931,750];
end

... The (default) figure_size didn't work, so it's commented out, and so I continue to reset the plot size for each plot individually.

Is this a Scilab bug, or is it my scripting being weird (again) ??

Best regards,
Claus

On 10-09-2017 13:35, Claus Futtrup wrote:

Hi there

When I create a new figure, I do newfig = scf();

Then to make the figure larger I do newfig.figure_size = [931,750]; // default is 626 x 587

// When height = 750 is specified, then it correctly becomes 817.

// I have no idea why. Scilab is a bit weird.

The top left corner stays the same, so the figure scales down. (Kinda smart, so you can always get hold of the top bar of the window), but unfortunately my PC monitor is not so large, the figure expand beyond the bottom of the screen.

Is there a way in which I can call scf() with the desired figure size already preset? ... something like scf(figure._size = [931,750]); maybe ?

Best regards,

Claus

 

 


_______________________________________________
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: figure_size

Hi Rafael

FYI, just adding auto_resize = "off" means that the actual plot doesn't resize to the new (bigger) plot area. I get a small plot in a larger plot area and lots of white space.

You're probably right, I need a combo of settings.

Best regards,
Claus

On 10-09-2017 14:19, Rafael Guerra wrote:

Hi Claus,

 

You probably also need to set:

 

p.auto_resize="off";

 

before  p.figure_size’; otherwise it  may not stick.

 

Regards,

Rafael

 

 

From: users [[hidden email]] On Behalf Of Claus Futtrup
Sent: Sunday, September 10, 2017 2:03 PM
To: International users mailing list for Scilab. [hidden email]
Subject: Re: [Scilab-users] figure_size

 

Hi all

I figured it out. At the beginning of the script I can call gdf and set parameters. I did:

if saveplots then // if plots are to be saved to disk, then
    plotsize = [931,750]; // make larger plot, default is 626 x 587
    p = gdf(); // Get Default Figure (p = PLOT) settings
    p.figure_position = [80,20]; // default is 200 x 200
//    p.figure_size = [931,750];
end

... The (default) figure_size didn't work, so it's commented out, and so I continue to reset the plot size for each plot individually.

Is this a Scilab bug, or is it my scripting being weird (again) ??

Best regards,
Claus

On 10-09-2017 13:35, Claus Futtrup wrote:

Hi there

When I create a new figure, I do newfig = scf();

Then to make the figure larger I do newfig.figure_size = [931,750]; // default is 626 x 587

// When height = 750 is specified, then it correctly becomes 817.

// I have no idea why. Scilab is a bit weird.

The top left corner stays the same, so the figure scales down. (Kinda smart, so you can always get hold of the top bar of the window), but unfortunately my PC monitor is not so large, the figure expand beyond the bottom of the screen.

Is there a way in which I can call scf() with the desired figure size already preset? ... something like scf(figure._size = [931,750]); maybe ?

Best regards,

Claus

 

 



_______________________________________________
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: figure_size

For your example, adding the p.axes_size command below should be enough:

 

p=gdf();

p.background=8;

p.figure_position = [80,20];

p.auto_resize="off";

p.figure_size = [931,750];

p.axes_size=[910,620];

 

plot2d() //create a figure

 

Regards,

Rafael

From: users [mailto:[hidden email]] On Behalf Of Claus Futtrup
Sent: Sunday, September 10, 2017 2:48 PM
To: [hidden email]
Subject: Re: [Scilab-users] figure_size

 

Hi Rafael

FYI, just adding auto_resize = "off" means that the actual plot doesn't resize to the new (bigger) plot area. I get a small plot in a larger plot area and lots of white space.

You're probably right, I need a combo of settings.

Best regards,
Claus

 


_______________________________________________
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: figure_size

Hi Rafael

You're right. I didn't find any other way (no automatic version). Thank you for your help.

What does p.background = "8" do? ... officially it sets the background color = white (the default). Is there a reason / a trick to it?

The biggest axis_size that works (for the 931 x 750 figure size) is [915,623]. This I found by trial and error. I didn't find an easy logical way to figure this out.

I think keeping auto_resize = "on" is OK. Then you can change the size (e.g. with your mouse) and the figure resizes accordingly (just wait a bit, it takes some seconds).

Thank you for your help. This is better because I don't have to resize during the script run (such resizing takes additional time to execute). I probably save half a minute every time I execute the script. :-)

Best regards,
Claus

On 10-09-2017 15:41, Rafael Guerra wrote:

For your example, adding the p.axes_size command below should be enough:

 

p=gdf();

p.background=8;

p.figure_position = [80,20];

p.auto_resize="off";

p.figure_size = [931,750];

p.axes_size=[910,620];

 

plot2d() //create a figure

 

Regards,

Rafael

From: users [[hidden email]] On Behalf Of Claus Futtrup
Sent: Sunday, September 10, 2017 2:48 PM
To: [hidden email]
Subject: Re: [Scilab-users] figure_size

 

Hi Rafael

FYI, just adding auto_resize = "off" means that the actual plot doesn't resize to the new (bigger) plot area. I get a small plot in a larger plot area and lots of white space.

You're probably right, I need a combo of settings.

Best regards,
Claus

 



_______________________________________________
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: figure_size

In reply to this post by Claus Futtrup
Hello,

Le 10/09/2017 à 13:35, Claus Futtrup a écrit :

Hi there

When I create a new figure, I do newfig = scf();

Then to make the figure larger I do newfig.figure_size = [931,750]; // default is 626 x 587

// When height = 750 is specified, then it correctly becomes 817.

// I have no idea why. Scilab is a bit weird.

The top left corner stays the same, so the figure scales down. (Kinda smart, so you can always get hold of the top bar of the window), but unfortunately my PC monitor is not so large, the figure expand beyond the bottom of the screen.

Is there a way in which I can call scf() with the desired figure size already preset? ... something like scf(figure._size = [931,750]); maybe ?


In Scilab 6:
--> scf().figure_size = [931 750];
--> // Isn't this great? There are not only weird things in Scilab ;)

In both Scilab 5 and 6:
--> set(scf(), "figure_size", [931 750]);

HTH
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: figure_size

In reply to this post by Claus Futtrup
Le 10/09/2017 à 14:47, Claus Futtrup a écrit :
> Hi Rafael
>
> FYI, just adding auto_resize = "off" means that the actual plot
> doesn't resize to the new (bigger) plot area. I get a small plot in a
> larger plot area and lots of white space.

Right. By the way, fig.auto_resize = "off" makes fig.figure_size prone
to the bug
http://bugzilla.scilab.org/14650

_______________________________________________
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: figure_size

In reply to this post by Claus Futtrup
Le 10/09/2017 à 14:03, Claus Futtrup a écrit :
Hi all

I figured it out. At the beginning of the script I can call gdf and set parameters. I did:

if saveplots then // if plots are to be saved to disk, then
    plotsize = [931,750]; // make larger plot, default is 626 x 587
    p = gdf(); // Get Default Figure (p = PLOT) settings
    p.figure_position = [80,20]; // default is 200 x 200
//    p.figure_size = [931,750];
end
... The (default) figure_size didn't work, so it's commented out, and so I continue to reset the plot size for each plot individually.

Is this a Scilab bug,

Yes it is: confirmed. It is not yet reported.
Just after calling scf() or figure(), the new figure is correctly sized according to the gdf().figure_size values.
After a fraction of a second, it is then resized to the default default sizes instead..


_______________________________________________
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: figure_size

In reply to this post by Samuel GOUGEON
Hi Samuel

Thanks for all the (different email) responses - and below tip how to directly put the figure size with the scf() command. This directly answers my initial question. Thanks.

How do you guys figure this out? Looking directly in the Scilab source-code? :-)

Best regards,
Claus

On 10-09-2017 17:15, Samuel Gougeon wrote:
Hello,

Le 10/09/2017 à 13:35, Claus Futtrup a écrit :

Hi there

When I create a new figure, I do newfig = scf();

Then to make the figure larger I do newfig.figure_size = [931,750]; // default is 626 x 587

// When height = 750 is specified, then it correctly becomes 817.

// I have no idea why. Scilab is a bit weird.

The top left corner stays the same, so the figure scales down. (Kinda smart, so you can always get hold of the top bar of the window), but unfortunately my PC monitor is not so large, the figure expand beyond the bottom of the screen.

Is there a way in which I can call scf() with the desired figure size already preset? ... something like scf(figure._size = [931,750]); maybe ?


In Scilab 6:
--> scf().figure_size = [931 750];
--> // Isn't this great? There are not only weird things in Scilab ;)

In both Scilab 5 and 6:
--> set(scf(), "figure_size", [931 750]);

HTH
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
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: figure_size

Le 10/09/2017 à 17:37, Claus Futtrup a écrit :
> Hi Samuel
>
> Thanks for all the (different email) responses - and below tip how to
> directly put the figure size with the scf() command. This directly
> answers my initial question. Thanks.
>
> How do you guys figure this out? Looking directly in the Scilab
> source-code? :-)

That's right, Claus, this new feature named "Recursive extraction" is
not documented (*), and even not announced in the 6.0.0 CHANGES page!
Apparently, it must remain confidential. It was just announced at the
last 2015 Scilabtech, and already sometimes addressed in this ML.
(*) http://bugzilla.scilab.org/14211#c6

Best regards
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: figure_size

In reply to this post by Samuel GOUGEON
Le 10/09/2017 à 17:32, Samuel Gougeon a écrit :
Le 10/09/2017 à 14:03, Claus Futtrup a écrit :
Hi all

I figured it out. At the beginning of the script I can call gdf and set parameters. I did:

if saveplots then // if plots are to be saved to disk, then
    plotsize = [931,750]; // make larger plot, default is 626 x 587
    p = gdf(); // Get Default Figure (p = PLOT) settings
    p.figure_position = [80,20]; // default is 200 x 200
//    p.figure_size = [931,750];
end
... The (default) figure_size didn't work, so it's commented out, and so I continue to reset the plot size for each plot individually.

Is this a Scilab bug,

Yes it is: confirmed. It is not yet reported.
Just after calling scf() or figure(), the new figure is correctly sized according to the gdf().figure_size values.
After a fraction of a second, it is then resized to the default default sizes instead..

It is now reported here: http://bugzilla.scilab.org/15270

This bug is a regression brought by Scilab 5.0! (yes: 5, not 6)


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