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

Federico Miyara fmiyara at fceia.unr.edu.ar
Sat Sep 4 00:59:34 CEST 2021


Philipp,

No, I don't want to have the figure maximized always; rather, to be able 
to toggle between normal size and maximized (when I need to focus on 
small details such as the difference between experimental and fitted 
graphs). That's actually why the current behavior is bothersome, since 
once redrawn, there is practically no difference between normal and 
maximized, so I cannot, for instance, see at the same time two figures. 
I need then to resize it manually. I shouldn't need to tweak the figure 
properties for that...

As to question 2, I refer to the normal location immediately after 
rendering the figure. The botton of the figure is hidden by the task bar 
so I find myself having to manually relocate each and all figures I 
create just to see its complete content, and that doesn't seem to be a 
normal or expected behavior.

I don't know if that happens only to me or everyone is experiencing this 
when the task bar is always visible.

Regards,

Federico Miyara





On 03/09/2021 07:39, P M wrote:
> 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 <mailto:fmiyara at fceia.unr.edu.ar>>:
>
>
>     Dear All,
>
>     I've noticed that when clearing the contents of a maximized figure
>     using clf() and redrawingthe figurefrom scratch,the maximized
>     statuschanges 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 <mailto:users at lists.scilab.org>
>     http://lists.scilab.org/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users



-- 
El software de antivirus Avast ha analizado este correo electrónico en busca de virus.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20210903/bd9cb5a6/attachment.htm>


More information about the users mailing list