Mercurial > hg > octave-terminal
changeset 10587:eb69d94e8648
Update the errorbar markers in a seperate listtener function
author | David Bateman <dbateman@free.fr> |
---|---|
date | Wed, 28 Apr 2010 21:10:03 +0200 |
parents | ec3cec8277df |
children | c1111769f595 |
files | scripts/ChangeLog scripts/plot/private/__errplot__.m |
diffstat | 2 files changed, 29 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-04-27 David Bateman <dbateman@free.fr> + + * plot/private/__errplot__.m: Update the marker in a seperate + listener function. + 2010-04-27 Rik <octave@nomad.inbox5.com> * plot/private/__go_draw_axes__.m: Use "." for marker when plotting
--- a/scripts/plot/private/__errplot__.m +++ b/scripts/plot/private/__errplot__.m @@ -135,23 +135,30 @@ endif endswitch + hl2 = __line__ (hg, "xdata", get (hl, "xdata"), + "ydata", get (hl, "ydata"), + "color", get (hl, "color"), + "linewidth", get (hl, "linewidth"), + "linestyle", get (hl, "linestyle"), + "marker", marker, "parent", hg); + addproperty ("color", hg, "linecolor", get (hl, "color")); addproperty ("linewidth", hg, "linelinewidth", get (hl, "linewidth")); addproperty ("linestyle", hg, "linelinestyle", get (hl, "linestyle")); - addproperty ("marker", hg, "linemarker", get (hl, "marker")); + addproperty ("marker", hg, "linemarker", get (hl2, "marker")); addproperty ("markerfacecolor", hg, "linemarkerfacecolor", - get (hl, "markerfacecolor")); + get (hl2, "markerfacecolor")); addproperty ("markeredgecolor", hg, "linemarkerfacecolor", - get (hl, "markeredgecolor")); + get (hl2, "markeredgecolor")); addproperty ("markersize", hg, "linemarkersize", - get (hl, "markersize")); + get (hl2, "markersize")); addlistener (hg, "color", @update_props); addlistener (hg, "linewidth", @update_props); addlistener (hg, "linestyle", @update_props); - addlistener (hg, "marker", @update_props); - addlistener (hg, "markerfacecolor", @update_props); - addlistener (hg, "markersize", @update_props); + addlistener (hg, "marker", @update_marker); + addlistener (hg, "markerfacecolor", @update_marker); + addlistener (hg, "markersize", @update_marker); addproperty ("xdata", hg, "data", get (hl, "xdata")); addproperty ("ydata", hg, "data", get (hl, "ydata")); @@ -167,22 +174,22 @@ addlistener (hg, "xldata", @update_data); addlistener (hg, "xudata", @update_data); - __line__ (hg, "xdata", get (hl, "xdata"), - "ydata", get (hl, "ydata"), - "color", get (hl, "color"), - "linewidth", get (hl, "linewidth"), - "linestyle", get (hl, "linestyle"), - "marker", marker, "parent", hg); endfor endfunction function update_props (h, d) set (get (h, "children"), "color", get (h, "color"), - "linewidth", get (h, "linewidth"), "linestyle", get (h, "linestyle"), - "marker", get (h, "marker"), "markersize", get (h, "markersize"), - "markerfacecolor", get (h, "markerfacecolor"), - "markeredgecolor", get (h, "markeredgecolor")); + "linewidth", get (h, "linewidth"), "linestyle", get (h, "linestyle")); +endfunction + +function update_marker (h, d) + kids = get (h, "children"); + kids (! cellfun (@isempty, get (kids, "ldata")) + & ! cellfun (@isempty, get (kids, "xldata"))) = []; + set (kids, "marker", get (h, "marker"), "markersize", get (h, "markersize"), + "markerfacecolor", get (h, "markerfacecolor"), "markeredgecolor", + get (h, "markeredgecolor")); endfunction function update_data (h, d)