# HG changeset patch # User dbateman # Date 1196712996 0 # Node ID 3a695b7adf8e39b1f23dfb9739127f0281fe3b6c # Parent 7d7f05863f2701cce129462947c56acea03276b0 [project @ 2007-12-03 20:16:36 by dbateman] diff -r 7d7f05863f27 -r 3a695b7adf8e scripts/ChangeLog --- a/scripts/ChangeLog Mon Dec 03 20:10:06 2007 +0000 +++ b/scripts/ChangeLog Mon Dec 03 20:16:36 2007 +0000 @@ -1,3 +1,10 @@ +2007-12-03 David Bateman + + * plot/plotyy.m: Use activepositionproperty property of axes + object. Set second axis color to "none". + * plot/__go_draw_axes__.m: Respect the activepositionproperty + property of the axis objects. + 2007-12-03 Thomas Treichl * linear-algebra/condest.m: Loosen tolerance in test. diff -r 7d7f05863f27 -r 3a695b7adf8e scripts/plot/__go_draw_axes__.m --- a/scripts/plot/__go_draw_axes__.m Mon Dec 03 20:10:06 2007 +0000 +++ b/scripts/plot/__go_draw_axes__.m Mon Dec 03 20:16:36 2007 +0000 @@ -33,18 +33,20 @@ ## Set axis properties here? pos = [0, 0, 1, 1]; - if (! isempty (axis_obj.outerposition)) - pos = axis_obj.outerposition; - endif - - ymirror = true; - if (! isempty (axis_obj.position)) - pos = axis_obj.position; - fprintf (plot_stream, "set tmargin 3;\n"); - fprintf (plot_stream, "set bmargin 3;\n"); - fprintf (plot_stream, "set lmargin 10;\n"); - fprintf (plot_stream, "set rmargin 10;\n"); + if (strcmp (axis_obj.activepositionproperty, "outerposition")) + ymirror = true; + if (! isempty (axis_obj.outerposition)) + pos = axis_obj.outerposition; + endif + else ymirror = false; + if (! isempty (axis_obj.position)) + pos = axis_obj.position; + fprintf (plot_stream, "set tmargin 0;\n"); + fprintf (plot_stream, "set bmargin 0;\n"); + fprintf (plot_stream, "set lmargin 0;\n"); + fprintf (plot_stream, "set rmargin 0;\n"); + endif endif if (! strcmp (axis_obj.__colorbar__, "none")) diff -r 7d7f05863f27 -r 3a695b7adf8e scripts/plot/plotyy.m --- a/scripts/plot/plotyy.m Mon Dec 03 20:10:06 2007 +0000 +++ b/scripts/plot/plotyy.m Mon Dec 03 20:16:36 2007 +0000 @@ -95,7 +95,8 @@ h1 = feval (fun1, x1, y1); set (ax(1), "ycolor", getcolor (h1(1))); - set (ax(1), "position", get (ax(1), "outerposition")); + set (ax(1), "position", [0.11 0.13 0.78 0.73]); + set (ax(1), "activepositionproperty", "position"); set (ax(1), "xlim", xlim); cf = gcf (); @@ -107,8 +108,10 @@ h2 = feval (fun2, x2, y2); set (ax(2), "yaxislocation", "right"); set (ax(2), "ycolor", getcolor (h2(1))); - set (ax(2), "position", get (ax(1), "outerposition")); + set (ax(2), "position", get (ax(1), "position")); + set (ax(2), "activepositionproperty", "position"); set (ax(2), "xlim", xlim); + set (ax(2), "color", "none"); endfunction function color = getcolor (ax) diff -r 7d7f05863f27 -r 3a695b7adf8e src/ChangeLog --- a/src/ChangeLog Mon Dec 03 20:10:06 2007 +0000 +++ b/src/ChangeLog Mon Dec 03 20:16:36 2007 +0000 @@ -1,3 +1,9 @@ +2007-12-02 David Bateman + + * graphics.cc (class axes): Add color and activepositionproperty + properties to axis objects. + * graphics.h.in (class axes): ditto. + 2007-12-03 David Bateman * DLD-FUNCTIONS/regexp.cc: Also include sys/types.h for regexp. diff -r 7d7f05863f27 -r 3a695b7adf8e src/graphics.cc --- a/src/graphics.cc Mon Dec 03 20:10:06 2007 +0000 +++ b/src/graphics.cc Mon Dec 03 20:16:36 2007 +0000 @@ -1114,6 +1114,7 @@ xticklabelmode ("auto"), yticklabelmode ("auto"), zticklabelmode ("auto"), + color (color_values(0, 0, 0), radio_values ("flat|none|interp")), xcolor (), ycolor (), zcolor (), @@ -1129,6 +1130,7 @@ visible ("on"), nextplot ("replace"), outerposition (), + activepositionproperty (radio_values ("{outerposition}|position")), __colorbar__ (radio_values ("{none}|north|south|east|west|northoutside|southoutside|eastoutside|westoutside")) { Matrix tlim (1, 2, 0.0); @@ -1306,6 +1308,8 @@ set_yticklabelmode (val); else if (name.compare ("zticklabelmode")) set_zticklabelmode (val); + else if (name.compare ("color")) + set_color (val); else if (name.compare ("xcolor")) set_xcolor (val); else if (name.compare ("ycolor")) @@ -1336,6 +1340,8 @@ set_nextplot (val); else if (name.compare ("outerposition")) set_outerposition (val); + else if (name.compare ("activepositionproperty")) + set_activepositionproperty (val); else if (name.compare ("__colorbar__")) set___colorbar__ (val); else @@ -1397,6 +1403,7 @@ xticklabelmode = "auto"; yticklabelmode = "auto"; zticklabelmode = "auto"; + color = color_property (color_values (0, 0, 0), radio_values("flat|none|interp")); xcolor = color_property ("black"); ycolor = color_property ("black"); zcolor = color_property ("black"); @@ -1427,6 +1434,7 @@ outerposition = touterposition; } + activepositionproperty = radio_property (radio_values ("{outerposition}|position")); __colorbar__ = radio_property (radio_values ("{none}|north|south|east|west|northoutside|southoutside|eastoutside|westoutside")); delete_children (); @@ -1520,6 +1528,7 @@ m.assign ("xticklabelmode", xticklabelmode); m.assign ("yticklabelmode", yticklabelmode); m.assign ("zticklabelmode", zticklabelmode); + m.assign ("color", color); m.assign ("xcolor", xcolor); m.assign ("ycolor", ycolor); m.assign ("zcolor", zcolor); @@ -1535,6 +1544,7 @@ m.assign ("visible", visible); m.assign ("nextplot", nextplot); m.assign ("outerposition", outerposition); + m.assign ("activepositionproperty", activepositionproperty); m.assign ("__colorbar__", __colorbar__); return m; @@ -1631,6 +1641,8 @@ retval = yticklabelmode; else if (name.compare ("zticklabelmode")) retval = zticklabelmode; + else if (name.compare ("color")) + retval = color; else if (name.compare ("xcolor")) retval = xcolor; else if (name.compare ("ycolor")) @@ -1661,6 +1673,8 @@ retval = nextplot; else if (name.compare ("outerposition")) retval = outerposition; + else if (name.compare ("activepositionproperty")) + retval = activepositionproperty; else if (name.compare ("__colorbar__")) retval = __colorbar__; else @@ -1747,6 +1761,7 @@ m["xticklabelmode"] = "auto"; m["yticklabelmode"] = "auto"; m["zticklabelmode"] = "auto"; + m["color"] = color_property (color_values (0, 0, 0), radio_values("flat|none|interp")); m["xcolor"] = color_property ("black"); m["ycolor"] = color_property ("black"); m["zcolor"] = color_property ("black"); @@ -1772,6 +1787,7 @@ touterposition(3) = 1; m["outerposition"] = touterposition; + m["activepositionproperty"] = radio_property (radio_values ("{outerposition}|position")); m["__colorbar__"] = radio_property (radio_values ("{none}|north|south|east|west|northoutside|southoutside|eastoutside|westoutside")); return m; diff -r 7d7f05863f27 -r 3a695b7adf8e src/graphics.h.in --- a/src/graphics.h.in Mon Dec 03 20:10:06 2007 +0000 +++ b/src/graphics.h.in Mon Dec 03 20:16:36 2007 +0000 @@ -1376,6 +1376,7 @@ octave_value xticklabelmode octave_value yticklabelmode octave_value zticklabelmode + color_property color a color_property xcolor color_property ycolor color_property zcolor @@ -1391,6 +1392,7 @@ octave_value visible octave_value nextplot octave_value outerposition + radio_property activepositionproperty a radio_property __colorbar__ a END_PROPERTIES