bugGNU Octave - Bugs: bug #52732, plot shrinks horizontally on...

 
 

bug #52732: plot shrinks horizontally on replotting

Submitted by:  A.R. Burgers <arb>
Submitted on:  Sat 23 Dec 2017 10:14:18 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 24 Dec 2017 04:10:59 AM UTC, comment #2:

Note that all of the following 'off', 'hide', 'delete' appear to work correctly. (Although, I am wondering what th difference is between 'off' and 'hide'... I would think that maybe 'off' should disable the colorbar such that the main plot goes back to the larger size while 'hide' doesn't show the colorbox but still occupies space so that the main plot remains smaller.)

The issue arises when doing another plot. Try the following:

The follow-up image command removes the colorbar so that it is no longer valid. That might be OK, if only the position were restored first just like what happens with colorbar('delete'). Maybe it is as simple as somehow issuing the delete to the color bar.

I'm curious what happens on 4.2.1. With the second "image;" command is the colorbar visible? Or does it disappear with a new plot? My guess would be the colorbar goes away; that seems to be the model, i.e., create the plot first and then decorate it--not the other way around.

Dan Sebald <sebald>
Sun 24 Dec 2017 03:06:19 AM UTC, comment #1:

Confirmed here on linux.

I see what the issue is, but before going forward I'll let Rik look at this a bit because (although this isn't a consequence of legend) he's been looking at the legend code and inside this colorbox.m code is this comment with regard to subfunction _position_colorbox_:

So, maybe he has the legend layout fresh in his mind and sees a way to address this and can remove the above FIXME comment.

The issues is basically the following code:

in which the colorbar position is computed and a new position for the plot is computed. If this is called repeatedly with every replot (and the parent axes are not deleted) the position properties of the parent axes keep getting updated. That's what is happening, which the printout below shows. Note that one would think that the above hunk of code would only be called once and conditioned out of the flow if the colorbox already exists. However, I've printed out some items (see above) that illustrate the colorbox keeps being deleted with every replot while obviously the parent axes are not being deleted. And I think that is what the core problem is.

Dan Sebald <sebald>
Sat 23 Dec 2017 10:14:18 PM UTC, original submission:

See the next script:

On every iteration of the loop the plot shrinks horizontally

  • both for qt and gnuplot toolkits
  • no shrinking for octave-4.2.1
  • no shrinking if all plots are closed before trisurf call
  • no shrinking if there is no colorbar
A.R. Burgers <arb>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by arb (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1