bugGNU Octave - Bugs: bug #57016, Autoscale is not called when the...

 
 

bug #57016: Autoscale is not called when the window size is changed from inside s function.

Submitted by:  Doug Stewart <dastew>
Submitted on:  Mon 07 Oct 2019 06:24:19 PM UTC  
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Assigned to:  None
Originator Name:  Doug Stewart Open/Closed:  Open
Release:  5.1.0 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Tue 08 Oct 2019 11:51:23 AM UTC, comment #6: 

yes that seems to fix it.

Doug Stewart <dastew>
Tue 08 Oct 2019 11:16:29 AM UTC, comment #5: 

Ok, I can confirm that if the figure doesn't exist before calling the script, the axes is not redrawn correctly until the next redraw.

I think this is the same kind of race condition as in bug #56110.  Here the workaround is to force graphics events to be processed before trying the resize the figure:

x = [1:1:100];
plot(x, sin(x));
drawnow
set(gcf, 'position', [get(gcf, 'position')(1:2) 800 400])

@Doug: do you agree that this is kind of a duplicate of bug #56110?

Pantxo Diribarne <pantxo>
Project Member
Mon 07 Oct 2019 10:02:57 PM UTC, comment #4: 

You must start with a fresh figure for the problem to be seen. After it has resized properly once then it always works.
here is what I get. (see attached file)
If i just click any where on the window it gets fixed.


Doug Stewart <dastew>
Mon 07 Oct 2019 08:42:34 PM UTC, comment #3: 

Yes, I just tried from a script and it still works for me (see attached screenshot after resize). Is the axes position correctly updated when you resize the figure with the mouse?


Pantxo Diribarne <pantxo>
Project Member
Mon 07 Oct 2019 07:52:17 PM UTC, comment #2: 

I  am using octave5.1.1 on ubuntu and the OP was on windows with 5.1.0
I am using QT graphics.
 did you try this in a function file?

Doug Stewart <dastew>
Mon 07 Oct 2019 07:44:12 PM UTC, comment #1: 

What graphics_toolkit are you using? This works for me with both qt and fltk. With gnuplot the figure window is not even resized.

This is equivalent to resizing the figure by dragging the upper-right corner with the mouse, and this also works as expected for me.

Pantxo Diribarne <pantxo>
Project Member
Mon 07 Oct 2019 06:24:19 PM UTC, original submission:  

    x = [1:1:100];
    plot(x, sin(x));
    set(gcf, 'position', [get(gcf, 'position')(1:2) 800 400]);

This code should cause an "autoscale" so that the plot fills the new size of the window.

Doug Stewart <dastew>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47626:  resized_figure.png added by pantxo (40KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by dastew (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-10-08 pantxo CategoryPlotting => Plotting with OpenGL
        StatusWorks For Me => Confirmed
    2019-10-07 dastew Attached File- => Added Screenshot@from@2019-10-07@17-58-19.png, #47627
    2019-10-07 pantxo Attached File- => Added resized_figure.png, #47626
    2019-10-07 pantxo StatusNone => Works For Me

    Back to the top


    Powered by Savane 3.5