bugGNU Octave - Bugs: bug #42033, subplot(4,1,4) clears previously...

 
 

bug #42033: subplot(4,1,4) clears previously drawn axes

Submitted by:  Armin Müller <arm_in>
Submitted on:  Thu 03 Apr 2014 08:15:16 AM UTC  
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  3.8.1 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)

Mon 09 Feb 2015 10:42:17 PM UTC, comment #7: 

Hi,

This is fixed with this changeset : http://hg.savannah.gnu.org/hgweb/octave/rev/8064b5cdbc11

Closing this report.

Pantxo Diribarne <pantxo>
Project Member
Wed 18 Jun 2014 11:33:25 AM UTC, comment #6: 

Yes Sébastien, I guess this is exactly the same error source.

I investigated some further. In subplot.m, there is a check if the axes object exists (and therefore is kept), or if the axes object is new and has to be crated, or if the user wants to explicitly replace the old axes object.

236: if (all (abs (objpos - outerpos) < eps) && ! replace_axes)

objpos =
   0.050000   0.050000   0.293406   0.900000

outerpos =
   0.050000   0.050000   0.291111   0.900000

For some reason, the re-calculated position is differing slighty from the original position. Therefore, the subplot is deleted.

255: delete (child);

As Mike pointed out, there are some similar errors:
bug #39874 => Similar but different, Version 3.7.6+, already fixed. Works for me in 3.8.1
bug #31610 => No idea
bug #41128 => Yes. To my understanding, Sébastian's and my report are due to the same error source as the one that is underlying in Daisuke's report. They all trigger a breakpoint in line 255.

However, I cannot easily manage to get through calculation of the positions :-/

Armin Müller <arm_in>
Wed 18 Jun 2014 10:16:24 AM UTC, comment #5: 

I have a similar issue. Here is a short example:

subplot(1,3,1)
plot(1:100);
subplot(1,3,1)

The plot is cleared when calling subplot again. Strange thing is that it does not happens for a two-columns plot (ie: subplot(1,2,1)).

Gnuplot 3.8.1 with fltk on ubuntu x64

Sébastien Blaise <sblaise>
Mon 07 Apr 2014 06:12:38 PM UTC, comment #4: 

By stepping through the original example, the bug is not that the hold property is lost but that switching to subplot(4,1,4) redraws the axes, clearing the plot that was there before.

This looks like another slightly different manifestation of bug #39874 (and maybe also having to do with bug #31610 and bug #41128).

Mike Miller <mtmiller>
Project Administrator
Fri 04 Apr 2014 05:46:12 PM UTC, comment #3: 

I think the behavior you are describing (comment #2) is actually bug #41128 (some subplots do not appear when N>4). Please direct comments about subplots not appearing to that bug report.

This bug report does not concern missing subplots, but the hold property on the 4th subplot in the original example given.

Mike Miller <mtmiller>
Project Administrator
Fri 04 Apr 2014 04:49:11 PM UTC, comment #2: 

I have tried in the linux dev version and the bug seems to be still less specific. Doing this:

figure(1)

for idx = 1:5
  subplot(5, 1, idx)
  plot( 1:10, 1:10)
end

That will plot a figure where the 4rth subplot is not shown and if you do the same with 6 subplots neither the 4rth nor the 5th will be shown.

Eduardo Ramos Fernández <edu159>
Thu 03 Apr 2014 07:43:39 PM UTC, comment #1: 

Confirmed with 3.8.1 on Linux using fltk. Gnuplot has a different problem, that's probably already a separate bug report.

Mike Miller <mtmiller>
Project Administrator
Thu 03 Apr 2014 08:15:16 AM UTC, original submission:  

When running the code below, a new figure divided into 4 subplots is created. Subplot 4 gets erased, although it has been set on hold.

Running Octave 3.8.1 under Windows 7 x64

% subplots 1, 2, 3 contain two lines each
% subplot 4 is not on "hold" and will be erased when plotting the second line

figure(1)

for idx = 1:4
  subplot(4, 1, idx)
  plot( 1:10, 1:10)
end

for idx = 1:4
  subplot(4, 1, idx)
  hold on
  plot(11:20, 1:10)
  hold off
end

Armin Müller <arm_in>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31110:  subplot4.png added by arm_in (28KiB - image/png)

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by damianonly (It's a quite annoying bug that renders my work unusable.)
  • -email is unavailable- added by sblaise (Posted a comment)
  • -email is unavailable- added by edu159 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by arm_in (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-09 pantxo Open/ClosedOpen => Closed
    2014-11-19 pantxo Dependencies- => bugs #43478 is dependent
    2014-07-31 andy1978 Dependencies- => Depends on bugs #41128
    2014-06-19 damianonly Carbon-Copy- => Added damian.only@gmail.com
    2014-04-07 mtmiller Summarysubplot() not on hold => subplot(4,1,4) clears previously drawn axes
    2014-04-03 mtmiller CategoryPlotting => Plotting with OpenGL
        Item GroupNone => Incorrect Result
        StatusNone => Confirmed
        Operating SystemMicrosoft Windows => Any
    2014-04-03 arm_in Attached File- => Added subplot4.png, #31110

    Back to the top


    Powered by Savane 3.5