[Top][All Lists]

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

[Octave-bug-tracker] [bug #53778] waitbar produces extra figure in 4.3.9

From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #53778] waitbar produces extra figure in 4.3.91
Date: Sat, 28 Apr 2018 21:34:17 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #3, bug #53778 (project octave):

Actually, I think the issue isn't whether ishold() should open a new figure,
but instead whether ishold() should be treated as a global setting or a
figure-specific property.  In patch (and about twenty five other locations)
ishold() is used without an input argument:

  ## FIXME: This is a hack to get 'layer' command to work for 2D patches
  ##        Alternative is much more complicated surgery in graphics.cc.
  ##        of get_children_limits() for 'z' axis and 'patch' object type.
  if (! ishold ())
    if (isempty (get (htmp, "zdata")))
      set (hax, "zlim", [-1 1]);

That means ishold() is referring to the presumably some global setting because
there is nothing indicating what ishold() should refer to.  In actuality,
ishold() refers to current axes; so technically ishold() on its own in this
context is wrong unless the current axes is the figure axes in question.

To see that "ishold()" refers to current figure *and* is a figure/axes
property, note the following:

>> figure(1)
>> ishold()
ans = 0
>> figure(2)
>> hold on
>> ishold()
ans = 1
>> figure(1)
>> ishold()
ans = 0
>> figure(3)
>> ishold()
ans = 0
>> figure(2)
>> ishold()
ans = 1

So, I believe in most cases we want to use "ishold (hax)" in these plotting
script files.  Attached is a patch which makes that change and seems to fix
the problem.  Think it over; seems right to me.

There is one exception in which an "ishold ()" is used by 

@linux ~/octave/octave/octave $ grep "ishold ()" */*/* -s
scripts/sparse/treeplot.m:  hold_is_on = ishold ();

but that treeplot routine does not accept an axes handle so can only be
applied to the current axes.

In the process of making these changes, I also notice some inconsistencies
(and then bugs) in the way that figure title is generated amongst qt, gnuplot
and FLTK toolkits.  Qt toolkit was generating "GNU Octave" when neither "name"
nor "numbertitle" were set.  The other two weren't doing that, so I made them
do that as well.  (That means a name of " " must be used to make the title bar
blank.)  Then I notice that set(wb, "numbertitle", true) was making a bogus
number appear.  So I fixed these items in the patch as well.

@Rik: Maybe the preference is that Qt toolkit should be more like FLTK and
*not* show anytihng in the title bar if there is no 'name' or 'numbertitle'
properties set.  If so, I can change that easily.

(file #44057)

Additional Item Attachment:

File name: octave-ishold_axes_dependent-djs2018apr28.patch Size:17 KB


Reply to this item at:


  Message sent via Savannah

reply via email to

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