Mercurial > hg > octave-lyh
changeset 7240:3a695b7adf8e
[project @ 2007-12-03 20:16:36 by dbateman]
author | dbateman |
---|---|
date | Mon, 03 Dec 2007 20:16:36 +0000 |
parents | 7d7f05863f27 |
children | da540e715d05 |
files | scripts/ChangeLog scripts/plot/__go_draw_axes__.m scripts/plot/plotyy.m src/ChangeLog src/graphics.cc src/graphics.h.in |
diffstat | 6 files changed, 49 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2007-12-03 David Bateman <dbateman@free.fr> + + * 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 <Thomas.Treichl@gmx.net> * linear-algebra/condest.m: Loosen tolerance in test.
--- a/scripts/plot/__go_draw_axes__.m +++ b/scripts/plot/__go_draw_axes__.m @@ -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"))
--- a/scripts/plot/plotyy.m +++ b/scripts/plot/plotyy.m @@ -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)
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2007-12-02 David Bateman <dbateman@free.fr> + + * graphics.cc (class axes): Add color and activepositionproperty + properties to axis objects. + * graphics.h.in (class axes): ditto. + 2007-12-03 David Bateman <dbateman@free.fr> * DLD-FUNCTIONS/regexp.cc: Also include sys/types.h for regexp.
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -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;
--- a/src/graphics.h.in +++ b/src/graphics.h.in @@ -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