octave-maintainers
[Top][All Lists]
Advanced

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

Problem with Ben's change to preserve axis propers when used with colorb


From: David Bateman
Subject: Problem with Ben's change to preserve axis propers when used with colorbars
Date: Thu, 16 Oct 2008 11:27:03 +0100
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

There is an issue with the changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/4e05ba66ead2

in that the Position and OuterPosition properties are preserved in newplot.. The problem can be seen with

pcolor(peaks())
colorbar()
pause(1)
plot(1:10)

The final plot has an allowance made for the colorbar that has already been deleted.. What is happening is that when a new axis is created, the Position and OuterPosition properties are being stored prior to the old axis being deleted, and it is at the point the old axis is deleted that the callback colorbar:reset_axis is called that removes the allowance for the colorbar in the Position property...

Why do the Position and OuterPosition properties need to be preserved? If there is no particular reason to preserve them, then I'd suggest the patch

diff --git a/scripts/plot/colorbar.m b/scripts/plot/colorbar.m
--- a/scripts/plot/colorbar.m
+++ b/scripts/plot/colorbar.m
@@ -186,7 +186,7 @@
  if (ishandle (h) && strcmp (get (h, "type"), "axes") &&
      (isempty (gcbf()) || strcmp (get (gcbf(), "beingdeleted"),"off")) &&
      ishandle (get (h, "axes")))
-    #set (get (h, "axes"), "position", pos, "outerposition", opos);
+     set (get (h, "axes"), "position", pos, "outerposition", opos);
  endif
endfunction

diff --git a/scripts/plot/newplot.m b/scripts/plot/newplot.m
--- a/scripts/plot/newplot.m
+++ b/scripts/plot/newplot.m
@@ -50,8 +50,6 @@
             "fontsize", get(ca, "fontsize"), ...
             "fontunits", get(ca, "fontunits"), ...
             "fontweight", get(ca, "fontweight"), ...
-             "position", get(ca, "position"), ...
-             "outerposition", get(ca, "outerposition"), ...
             "activepositionproperty", get(ca, "activepositionproperty")};
    __go_axes_init__ (ca, "replace");
    set (ca, fontprops{:});

be included. I'm not sure why the actual reset in the callback was commented out. Ben can you comment on why the preservation of the Position and OuterPosition properties was needed?

Regards
David

--
David Bateman                                address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax) The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary



reply via email to

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