comparison scripts/plot/private/__errplot__.m @ 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 6a81e809a392
children 083e4f6143fe
comparison
equal deleted inserted replaced
10586:ec3cec8277df 10587:eb69d94e8648
133 else 133 else
134 error ("error plot with 6 columns only valid for boxxy and xyerr"); 134 error ("error plot with 6 columns only valid for boxxy and xyerr");
135 endif 135 endif
136 endswitch 136 endswitch
137 137
138 hl2 = __line__ (hg, "xdata", get (hl, "xdata"),
139 "ydata", get (hl, "ydata"),
140 "color", get (hl, "color"),
141 "linewidth", get (hl, "linewidth"),
142 "linestyle", get (hl, "linestyle"),
143 "marker", marker, "parent", hg);
144
138 addproperty ("color", hg, "linecolor", get (hl, "color")); 145 addproperty ("color", hg, "linecolor", get (hl, "color"));
139 addproperty ("linewidth", hg, "linelinewidth", get (hl, "linewidth")); 146 addproperty ("linewidth", hg, "linelinewidth", get (hl, "linewidth"));
140 addproperty ("linestyle", hg, "linelinestyle", get (hl, "linestyle")); 147 addproperty ("linestyle", hg, "linelinestyle", get (hl, "linestyle"));
141 addproperty ("marker", hg, "linemarker", get (hl, "marker")); 148 addproperty ("marker", hg, "linemarker", get (hl2, "marker"));
142 addproperty ("markerfacecolor", hg, "linemarkerfacecolor", 149 addproperty ("markerfacecolor", hg, "linemarkerfacecolor",
143 get (hl, "markerfacecolor")); 150 get (hl2, "markerfacecolor"));
144 addproperty ("markeredgecolor", hg, "linemarkerfacecolor", 151 addproperty ("markeredgecolor", hg, "linemarkerfacecolor",
145 get (hl, "markeredgecolor")); 152 get (hl2, "markeredgecolor"));
146 addproperty ("markersize", hg, "linemarkersize", 153 addproperty ("markersize", hg, "linemarkersize",
147 get (hl, "markersize")); 154 get (hl2, "markersize"));
148 155
149 addlistener (hg, "color", @update_props); 156 addlistener (hg, "color", @update_props);
150 addlistener (hg, "linewidth", @update_props); 157 addlistener (hg, "linewidth", @update_props);
151 addlistener (hg, "linestyle", @update_props); 158 addlistener (hg, "linestyle", @update_props);
152 addlistener (hg, "marker", @update_props); 159 addlistener (hg, "marker", @update_marker);
153 addlistener (hg, "markerfacecolor", @update_props); 160 addlistener (hg, "markerfacecolor", @update_marker);
154 addlistener (hg, "markersize", @update_props); 161 addlistener (hg, "markersize", @update_marker);
155 162
156 addproperty ("xdata", hg, "data", get (hl, "xdata")); 163 addproperty ("xdata", hg, "data", get (hl, "xdata"));
157 addproperty ("ydata", hg, "data", get (hl, "ydata")); 164 addproperty ("ydata", hg, "data", get (hl, "ydata"));
158 addproperty ("ldata", hg, "data", get (hl, "ldata")); 165 addproperty ("ldata", hg, "data", get (hl, "ldata"));
159 addproperty ("udata", hg, "data", get (hl, "udata")); 166 addproperty ("udata", hg, "data", get (hl, "udata"));
165 addlistener (hg, "ldata", @update_data); 172 addlistener (hg, "ldata", @update_data);
166 addlistener (hg, "udata", @update_data); 173 addlistener (hg, "udata", @update_data);
167 addlistener (hg, "xldata", @update_data); 174 addlistener (hg, "xldata", @update_data);
168 addlistener (hg, "xudata", @update_data); 175 addlistener (hg, "xudata", @update_data);
169 176
170 __line__ (hg, "xdata", get (hl, "xdata"),
171 "ydata", get (hl, "ydata"),
172 "color", get (hl, "color"),
173 "linewidth", get (hl, "linewidth"),
174 "linestyle", get (hl, "linestyle"),
175 "marker", marker, "parent", hg);
176 endfor 177 endfor
177 178
178 endfunction 179 endfunction
179 180
180 function update_props (h, d) 181 function update_props (h, d)
181 set (get (h, "children"), "color", get (h, "color"), 182 set (get (h, "children"), "color", get (h, "color"),
182 "linewidth", get (h, "linewidth"), "linestyle", get (h, "linestyle"), 183 "linewidth", get (h, "linewidth"), "linestyle", get (h, "linestyle"));
183 "marker", get (h, "marker"), "markersize", get (h, "markersize"), 184 endfunction
184 "markerfacecolor", get (h, "markerfacecolor"), 185
185 "markeredgecolor", get (h, "markeredgecolor")); 186 function update_marker (h, d)
187 kids = get (h, "children");
188 kids (! cellfun (@isempty, get (kids, "ldata"))
189 & ! cellfun (@isempty, get (kids, "xldata"))) = [];
190 set (kids, "marker", get (h, "marker"), "markersize", get (h, "markersize"),
191 "markerfacecolor", get (h, "markerfacecolor"), "markeredgecolor",
192 get (h, "markeredgecolor"));
186 endfunction 193 endfunction
187 194
188 function update_data (h, d) 195 function update_data (h, d)
189 x = get (h, "xdata"); 196 x = get (h, "xdata");
190 y = get (h, "ydata"); 197 y = get (h, "ydata");