[Scilab-users] Redrawing a maximized figure changes its original size and other problem

P M p.muehlmann at gmail.com
Fri Sep 3 12:39:31 CEST 2021


Hi Federico,

Assuming that you ALWAYS want to have the figure at max screen size:

Question 1:

You can work with the screen width/height values to maximize the figure.

To get the screen values you can use:
- screenWidth =  getsystemmetrics('SM_CXSCREEN')
- screenHeight = getsystemmetrics('SM_CYSCREEN')

Your figureHeight may be some pixels less than the sceen Height, so that
the taskbar won't be covered.

With these values you can set the figure size using the figure properties.

Question 2:
Maximising a figure at my PC results in a full screen figure, with the
taskbar at the screen bottom beeing visible.

Having the correct figure size (see Question 1), you can set the figure
position by:
gcf().figure_position = .....



Other approach:

Instead of clearing the complete figure, you maybe only need to clear the
graph (entitiy).
If you have multiple graphs in one figure, the approach is similar, but you
need to pick the correct entity.

Assumption:  Only one graph within a single figure.

x = linspace(1,100,100);y = sin(x);
f = figure(101);f.background = -2;plot(x,y);a = gca();e = gce();p =
e.children();

--> Now maximize the figure manually or have it already a max screen size


p.data = [];            // clearing the data of the graph ... same as
a.children.children.data = []y = cos(x);             // simulating
new data p.data = [x; y]';       // replotting the graph with new data


Note:  The approach does not change the axis min/max values....so you maybe
need to tweak these parameters, depending on your data.


Good luck,
Philipp






Am Do., 2. Sept. 2021 um 02:24 Uhr schrieb Federico Miyara <
fmiyara at fceia.unr.edu.ar>:

>
> Dear All,
>
> I've noticed that when clearing the contents of a maximized figure using
> clf() and redrawing the figure from scratch, the maximized status changes
> status to normal with a size slightly larger than the available height of
> the screen. When maximizing it, it really shrinks to the available screen
> space. For instance
>
> figure(101);
> scf(101);
> clf(101);
> gcf().background = -2;
> plot(x, y)
>
> (I use this structure when I have several figures and need to refresh one
> of them).
>
> The presence of the first instruction is necessary for this to happen. The
> original (default) size is not recovered unless the figure is completely
> cleared.
>
> The second problem is that upon creation, any figure is located flush with
> the bottom of the screen, even if I have enabled that the task bar is
> always visible. This causes the bottom of the figure to be hidden behind
> the task bar. To make it vissible I need to manually move the figure
> upwards.
>
> The expected behavior would be that the window were completely visible
> from the beginning.
>
> I'm on Windows 7.
>
> Regards,
>
> Federico Miyara
>
>
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Libre
> de virus. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
> <#m_1245799826228827734_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210903/943e1fab/attachment.htm>


More information about the users mailing list