Mercurial > hg > octave-lyh
comparison scripts/plot/__add_line_series__.m @ 8070:3b53b25e2550
Add data sources and line series
author | David Bateman <dbateman@free.fr> |
---|---|
date | Thu, 28 Aug 2008 12:23:54 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
8069:c64c9581e9bf | 8070:3b53b25e2550 |
---|---|
1 ## Copyright (C) 2008 David Bateman | |
2 ## | |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## Undocumented internal function | |
20 | |
21 function __add_line_series__ (h, hg) | |
22 | |
23 obj = get(h); | |
24 | |
25 addproperty ("color", hg, "linecolor", obj.color); | |
26 addproperty ("linewidth", hg, "linelinewidth", obj.linewidth); | |
27 addproperty ("linestyle", hg, "linelinestyle", obj.linestyle); | |
28 addproperty ("marker", hg, "linemarker", obj.marker); | |
29 addproperty ("markeredgecolor", hg, "linemarkerfacecolor", | |
30 obj.markeredgecolor); | |
31 addproperty ("markerfacecolor", hg, "linemarkerfacecolor", | |
32 obj.markerfacecolor); | |
33 addproperty ("markersize", hg, "linemarkersize", obj.markersize); | |
34 | |
35 addlistener (hg, "color", @update_props); | |
36 addlistener (hg, "linewidth", @update_props); | |
37 addlistener (hg, "linestyle", @update_props); | |
38 addlistener (hg, "marker", @update_props); | |
39 addlistener (hg, "markeredgecolor", @update_props); | |
40 addlistener (hg, "markerfacecolor", @update_props); | |
41 addlistener (hg, "markersize", @update_props); | |
42 | |
43 addproperty ("xdata", hg, "data", obj.xdata); | |
44 addproperty ("ydata", hg, "data", obj.ydata); | |
45 addproperty ("zdata", hg, "data", obj.zdata); | |
46 | |
47 addlistener (hg, "xdata", @update_props); | |
48 addlistener (hg, "ydata", @update_props); | |
49 addlistener (hg, "zdata", @update_props); | |
50 endfunction | |
51 | |
52 function update_props (h, d) | |
53 set (get (h, "children"), "color", get (h, "color"), | |
54 "linewidth", get (h, "linewidth"), | |
55 "linestyle", get (h, "linestyle"), | |
56 "marker", get (h, "marker"), | |
57 "markerfacecolor", get (h, "markerfacecolor"), | |
58 "markeredgecolor", get (h, "markeredgecolor"), | |
59 "markersize", get (h, "markersize"), | |
60 "xdata", get (h, "xdata"), | |
61 "ydata", get (h, "ydata"), | |
62 "zdata", get (h, "zdata")); | |
63 endfunction | |
64 |