octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59076] subplot replaces previously created ax


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #59076] subplot replaces previously created axes
Date: Mon, 7 Sep 2020 05:35:50 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 Edg/85.0.564.44

Update of bug #59076 (project octave):

                Severity:              3 - Normal => 2 - Minor              
                Priority:              5 - Normal => 3 - Low                
              Item Group:                    None => Feature Request        
                  Status:                    None => Confirmed              
                 Release:                  6.0.90 => dev                    
        Operating System:       Microsoft Windows => Any                    
                 Summary: subplot clears the plot => subplot replaces
previously created axes

    _______________________________________________________

Follow-up Comment #1:

Confirmed here.

Something leads to the positions of the existing axes and the axes that
"subplot" wants to create not matching. That means that the following action
(from the doc) is executed:
> Any previously existing axes that would be (partly) covered by the newly
created axes are deleted. 
The difference is only very minor. And I agree that the old axes should
probably be reused.
There have been a bunch of similar bug reports in the past.

If I run your code in Matlab R2020a, the axes are reused (instead of
replaced).
I see that the figure has the following user appdata:

>> getappdata(gcf)

ans = 

  struct with fields:

    SubplotDefaultAxesLocation: [0.1300 0.1100 0.7750 0.8150]
              SubplotListeners: []
       SubplotListenersManager: [1×1
matlab.graphics.internal.SubplotListenersManager]
                  SubplotDirty: []
                   SubplotGrid: [2×1 Axes]


The two axes handles in "SubplotGrid" correspond to the two axes in the
subplot.

AFAICS, Octave tries to recognize subplot axes "from scratch" each time it is
called. It doesn't keep track of which axes are part of a "subplot" layout.
Maybe doing something similar in Octave would make it easier for "subplot" to
recognize axes it could re-use (instead of replace).

In the meantime, you could call "subplot" with the handle to the existing axes
(like you already wrote).

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59076>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]