# HG changeset patch # User David Bateman # Date 1224164948 -3600 # Node ID 53dbbd3314980e7ba472995c0e09722707518b4e # Parent 586b02ac671e95ebeb113358e937604ff4cf3d6b Preserve font and position properties when axes are replace in the handle code diff -r 586b02ac671e -r 53dbbd331498 scripts/ChangeLog --- a/scripts/ChangeLog Thu Oct 16 09:19:48 2008 -0400 +++ b/scripts/ChangeLog Thu Oct 16 14:49:08 2008 +0100 @@ -4,6 +4,13 @@ 2008-10-16 David Bateman + * plot/colorbar.m (colorbar:resetaxis): Uncomment the reseting of + the axes. + + * plot/newplot.m: Don't preserve axes properties here, but rather + do it in the graphics handle code so that the preservation can be + done after callbacks are executed. + * plot/__go_draw_axes__.m: If current plot is an image, don't flag the plot as binary, as the binary specification is already in the "usingclause". diff -r 586b02ac671e -r 53dbbd331498 scripts/plot/colorbar.m --- a/scripts/plot/colorbar.m Thu Oct 16 09:19:48 2008 -0400 +++ b/scripts/plot/colorbar.m Thu Oct 16 14:49:08 2008 +0100 @@ -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 -r 586b02ac671e -r 53dbbd331498 scripts/plot/newplot.m --- a/scripts/plot/newplot.m Thu Oct 16 09:19:48 2008 -0400 +++ b/scripts/plot/newplot.m Thu Oct 16 14:49:08 2008 +0100 @@ -44,17 +44,7 @@ case "add" case "replacechildren" case "replace" - ## Preserve certain axes properties - fontprops = {"fontangle", get(ca, "fontangle"), ... - "fontname", get(ca, "fontname"), ... - "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{:}); __request_drawnow__ (); otherwise error ("newplot: unrecognized nextplot property for current axes"); diff -r 586b02ac671e -r 53dbbd331498 src/ChangeLog --- a/src/ChangeLog Thu Oct 16 09:19:48 2008 -0400 +++ b/src/ChangeLog Thu Oct 16 14:49:08 2008 +0100 @@ -1,3 +1,10 @@ +2008-10-16 David Bateman + + * graphics.cc (void axes::properties::set_defaults + (base_graphics_object&, const std::string&)): Preserve font + and position properties if the axis is "replaced". + + 2008-10-16 John W. Eaton * graphics.h.in (class axes::properties): New property: interpreter. diff -r 586b02ac671e -r 53dbbd331498 src/graphics.cc --- a/src/graphics.cc Thu Oct 16 09:19:48 2008 -0400 +++ b/src/graphics.cc Thu Oct 16 14:49:08 2008 +0100 @@ -2269,11 +2269,6 @@ cameraviewanglemode = "auto"; plotboxaspectratio = Matrix (1, 3, 1.0); drawmode = "normal"; - fontangle = "normal"; - fontname = "Helvetica"; - fontsize = 12; - fontunits = "points"; - fontweight = "normal"; gridlinestyle = ":"; linestyleorder = "-"; linewidth = 0.5; @@ -2297,20 +2292,24 @@ visible = "on"; nextplot = "replace"; - // FIXME -- this is not quite right; we should preserve - // "position" and "units". - if (mode != "replace") { + fontangle = "normal"; + fontname = "Helvetica"; + fontsize = 12; + fontunits = "points"; + fontweight = "normal"; + Matrix touterposition (1, 4, 0.0); touterposition(2) = 1; touterposition(3) = 1; outerposition = touterposition; position = default_axes_position (); + + activepositionproperty = "outerposition"; } - activepositionproperty = "outerposition"; delete_children ();