[Top][All Lists]

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

[Octave-bug-tracker] [bug #52732] plot shrinks horizontally on replottin

From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #52732] plot shrinks horizontally on replotting
Date: Sat, 23 Dec 2017 22:06:20 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #1, bug #52732 (project octave):

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__:

## FIXME: The algorithm for positioning in legend.m is much more
##        and should be borrowed for colorbar.  One problem is that colorbar
##        positioning does not take in to account multi-line axes labels
function [pos, cpos, vertical, mirr] = __position_colorbox__ (cbox, props,

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:

    [pos, cpos, vertical, mirror] = __position_colorbox__ (loc, props, hpar);
    set (hax, "position", pos);

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.

octave:9> close all
ans = INSIDE __cb_axes_deleted__
octave:10> for i = 1 : 5
>     % close all
> %    trisurf(tri, x, y, x + y);
> image();
>     view(2);
>     myhcb = colorbar()
>     pause
> end
hax = -13.659
ans = INSIDE __position_colorbox__
pos =

   0.13000   0.11000   0.62000   0.81500

cpos =

   0.827500   0.110000   0.046500   0.815000

myhcb = -7.2883
ans = INSIDE __cb_axes_deleted__
hax = -13.659
ans = INSIDE __position_colorbox__
pos =

   0.13000   0.11000   0.49600   0.81500

cpos =

   0.688000   0.110000   0.037200   0.815000

myhcb = -7.5177
ans = INSIDE __cb_axes_deleted__
hax = -13.659
ans = INSIDE __position_colorbox__
pos =

   0.13000   0.11000   0.39680   0.81500

cpos =

   0.576400   0.110000   0.029760   0.815000

myhcb = -7.8976


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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