annotate scripts/plot/private/__errplot__.m @ 10580:1479b93ee655

Respect linestyleorder in errorbar plots
author David Bateman <dbateman@free.fr>
date Wed, 28 Apr 2010 00:23:57 +0200
parents 384c514bbae2
children e2a4e87b900c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
1 ## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
2 ## Teemu Ikonen
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
3 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
4 ## This file is part of Octave.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
5 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
6 ## Octave is free software; you can redistribute it and/or modify it
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
7 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
8 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
9 ## your option) any later version.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
10 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
11 ## Octave is distributed in the hope that it will be useful, but
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
14 ## General Public License for more details.
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
15 ##
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
16 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
17 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
18 ## <http://www.gnu.org/licenses/>.
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
19
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8506
diff changeset
20 ## -*- texinfo -*-
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8506
diff changeset
21 ## @deftypefn {Function File} {@var{h} =} __errplot__ (@var{fstr}, @var{p}, @dots{})
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6736
diff changeset
22 ## Undocumented internal function.
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8506
diff changeset
23 ## @end deftypefn
5720
067948dc39bf [project @ 2006-03-28 11:25:29 by jwe]
jwe
parents: 5642
diff changeset
24
3718
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
25 ## Created: 18.7.2000
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
26 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi>
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
27 ## Keywords: errorbar, plotting
65c6da68ddb3 [project @ 2000-09-08 06:50:02 by jwe]
jwe
parents:
diff changeset
28
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents: 6257
diff changeset
29 function h = __errplot__ (fstr, p, a1, a2, a3, a4, a5, a6)
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents: 5395
diff changeset
30
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6203
diff changeset
31 if (nargin < 4 || nargin > 8) # at least two data arguments needed
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 6004
diff changeset
32 print_usage ();
4897
89eee52fd4c7 [project @ 2004-06-03 23:07:55 by jwe]
jwe
parents: 4717
diff changeset
33 endif
4007
31448e09d38e [project @ 2002-07-26 01:47:32 by jwe]
jwe
parents: 4006
diff changeset
34
8259
dad9a322c639 Remove debugging from previous patch
David Bateman <dbateman@free.fr>
parents: 8258
diff changeset
35 [fmt, key] = __pltopt__ ("__errplot__", fstr);
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 6046
diff changeset
36
6172
2de853a110df [project @ 2006-11-15 22:53:47 by jwe]
jwe
parents: 6168
diff changeset
37 [len, nplots] = size (a1);
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
38 h = [];
4007
31448e09d38e [project @ 2002-07-26 01:47:32 by jwe]
jwe
parents: 4006
diff changeset
39
4897
89eee52fd4c7 [project @ 2004-06-03 23:07:55 by jwe]
jwe
parents: 4717
diff changeset
40 for i = 1:nplots
6736
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
41 ## Set the plot type based on linestyle.
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
42
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
43 if (strcmp (fmt.errorstyle, "~"))
6736
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
44 ifmt = "yerr";
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
45 elseif (strcmp (fmt.errorstyle, ">"))
6736
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
46 ifmt = "xerr";
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
47 elseif (strcmp (fmt.errorstyle, "~>"))
6736
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
48 ifmt = "xyerr";
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
49 elseif (strcmp (fmt.errorstyle, "#"))
6736
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
50 ifmt = "box";
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
51 elseif (strcmp (fmt.errorstyle, "#~"))
6736
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
52 ifmt = "boxy";
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
53 elseif (strcmp (fmt.linestyle, "#~>"))
6736
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
54 ifmt = "boxxy";
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
55 else
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
56 ifmt = "~";
10576
384c514bbae2 Allow setting of the markers in errorbar linestyles
David Bateman <dbateman@free.fr>
parents: 10575
diff changeset
57 endif
384c514bbae2 Allow setting of the markers in errorbar linestyles
David Bateman <dbateman@free.fr>
parents: 10575
diff changeset
58
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
59 hg = hggroup ("parent", p);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
60 h = [h; hg];
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
61 args = __add_datasource__ ("__errplot__", hg,
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
62 {"x", "y", "l", "u", "xl", "xu"});
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
63
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
64 if (isempty (fmt.marker) && isempty (fmt.linestyle))
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
65 [linestyle, marker] = __next_line_style__ ();
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
66 if (isempty (fmt.color))
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
67 hl = __line__ (hg, "linestyle", linestyle, "marker", marker,
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
68 "color", __next_line_color__ ())
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
69 else
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
70 hl = __line__ (hg, "linestyle", linestyle, "marker", marker,
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
71 "color", fmt.color)
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
72 endif
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
73 else
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
74 if (isempty (fmt.color))
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
75 hl = __line__ (hg, "linestyle", fmt.linestyle, "marker", fmt.marker,
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
76 "color", __next_line_color__ ())
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
77 else
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
78 hl = __line__ (hg, "linestyle", fmt.linestyle, "marker", fmt.marker,
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
79 "color", fmt.color)
10575
3eba2cc7cbda Allow matlab style linestyles in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10573
diff changeset
80 endif
3eba2cc7cbda Allow matlab style linestyles in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10573
diff changeset
81 endif
3eba2cc7cbda Allow matlab style linestyles in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10573
diff changeset
82
8506
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8259
diff changeset
83 ## FIXME -- note the code below adds the errorbar data directly as
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8259
diff changeset
84 ## ldata, etc properties of the line objects, as gnuplot can handle
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8259
diff changeset
85 ## this. Matlab has the errorbar part of the plot as a special line
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8259
diff changeset
86 ## object with embedded NaNs that draws the three segments of the
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8259
diff changeset
87 ## bar separately. Should we duplicate Matlab's behavior and stop
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8259
diff changeset
88 ## using the ldata, etc. properties of the line objects that are
bc982528de11 comment style fixes
John W. Eaton <jwe@octave.org>
parents: 8259
diff changeset
89 ## Octace specific?
6736
751f340d486c [project @ 2007-06-15 21:31:38 by jwe]
jwe
parents: 6448
diff changeset
90
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6203
diff changeset
91 switch (nargin - 2)
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
92 case 1
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
93 error ("error plot requires 2, 3, 4 or 6 columns");
4897
89eee52fd4c7 [project @ 2004-06-03 23:07:55 by jwe]
jwe
parents: 4717
diff changeset
94 case 2
10573
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
95 if (index (ifmt, "xerr"))
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
96 set (hl, "xdata", (1:len)', "ydata", a1(:,i), "xldata", a2(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
97 "xudata", a2(:,i));
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
98 elseif (index (ifmt, "yerr"))
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
99 set (hl, "xdata", (1:len)', "ydata", a1(:,i), "ldata", a2(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
100 "udata", a2(:,i));
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
101 else
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
102 error ("2 column errorplot is only valid or xerr or yerr");
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
103 endif
4897
89eee52fd4c7 [project @ 2004-06-03 23:07:55 by jwe]
jwe
parents: 4717
diff changeset
104 case 3
10573
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
105 if (index (ifmt, "boxxy") || index (ifmt, "xyerr"))
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
106 set (hl, "xdata", (1:len)', "ydata", a1(:,i), "xldata", a2(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
107 "xudata", a2(:,i), "ldata", a3(:,i), "udata", a3(:,i));
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
108 elseif (index (ifmt, "xerr"))
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
109 set (hl, "xdata", a1(:,i), "ydata", a2(:,i), "xldata", a3(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
110 "xudata", a3(:,i));
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
111 else
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
112 set (hl, "xdata", a1(:,i), "ydata", a2(:,i), "ldata", a3(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
113 "udata", a3(:,i));
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
114 endif
4897
89eee52fd4c7 [project @ 2004-06-03 23:07:55 by jwe]
jwe
parents: 4717
diff changeset
115 case 4
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
116 if (index (ifmt, "boxxy") || index (ifmt, "xyerr"))
10573
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
117 set (hl, "xdata", a1(:,i), "ydata", a2(:,i), "xldata", a3(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
118 "xudata", a3(:,i), "ldata", a4(:,i), "udata", a4(:,i));
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
119 elseif (index (ifmt, "xerr"))
10573
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
120 set (hl, "xdata", a1(:,i), "ydata", a2(:,i), "xldata", a3(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
121 "xudata", a4(:,i));
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
122 else
10573
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
123 set (hl, "xdata", a1(:,i), "ydata", a2(:,i), "ldata", a3(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
124 "udata", a4(:,i));
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
125 endif
4897
89eee52fd4c7 [project @ 2004-06-03 23:07:55 by jwe]
jwe
parents: 4717
diff changeset
126 case 5
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
127 error ("error plot requires 2, 3, 4 or 6 columns");
4897
89eee52fd4c7 [project @ 2004-06-03 23:07:55 by jwe]
jwe
parents: 4717
diff changeset
128 case 6
10573
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
129 if (index (ifmt, "boxxy") || index (ifmt, "xyerr"))
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
130 set (hl, "xdata", a1(:,i), "ydata", a2(:,i), "xldata", a3(:,i),
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
131 "xudata", a4(:,i), "ldata", a5(:,i), "udata", a6(:,i));
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
132 else
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
133 error ("error plot with 6 columns only valid for boxxy and xyerr");
d8894a2d0a03 Allow x, xy and box errorbars with different plotting syntax
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
134 endif
4897
89eee52fd4c7 [project @ 2004-06-03 23:07:55 by jwe]
jwe
parents: 4717
diff changeset
135 endswitch
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
136
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
137 addproperty ("color", hg, "linecolor", get (hl, "color"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
138 addproperty ("linewidth", hg, "linelinewidth", get (hl, "linewidth"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
139 addproperty ("linestyle", hg, "linelinestyle", get (hl, "linestyle"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
140 addproperty ("marker", hg, "linemarker", get (hl, "marker"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
141 addproperty ("markerfacecolor", hg, "linemarkerfacecolor",
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
142 get (hl, "markerfacecolor"));
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
143 addproperty ("markeredgecolor", hg, "linemarkerfacecolor",
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
144 get (hl, "markeredgecolor"));
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
145 addproperty ("markersize", hg, "linemarkersize",
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
146 get (hl, "markersize"));
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
147
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
148 addlistener (hg, "color", @update_props);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
149 addlistener (hg, "linewidth", @update_props);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
150 addlistener (hg, "linestyle", @update_props);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
151 addlistener (hg, "marker", @update_props);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
152 addlistener (hg, "markerfacecolor", @update_props);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
153 addlistener (hg, "markersize", @update_props);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
154
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
155 addproperty ("xdata", hg, "data", get (hl, "xdata"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
156 addproperty ("ydata", hg, "data", get (hl, "ydata"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
157 addproperty ("ldata", hg, "data", get (hl, "ldata"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
158 addproperty ("udata", hg, "data", get (hl, "udata"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
159 addproperty ("xldata", hg, "data", get (hl, "xldata"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
160 addproperty ("xudata", hg, "data", get (hl, "xudata"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
161
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
162 addlistener (hg, "xdata", @update_data);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
163 addlistener (hg, "ydata", @update_data);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
164 addlistener (hg, "ldata", @update_data);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
165 addlistener (hg, "udata", @update_data);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
166 addlistener (hg, "xldata", @update_data);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
167 addlistener (hg, "xudata", @update_data);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
168
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
169 __line__ (hg, "xdata", get (hl, "xdata"),
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
170 "ydata", get (hl, "ydata"),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
171 "color", get (hl, "color"),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
172 "linewidth", get (hl, "linewidth"),
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 9896
diff changeset
173 "linestyle", get (hl, "linestyle"),
10580
1479b93ee655 Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents: 10576
diff changeset
174 "marker", get (hl, "marker"), "parent", hg);
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents: 5395
diff changeset
175 endfor
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents: 5395
diff changeset
176
4007
31448e09d38e [project @ 2002-07-26 01:47:32 by jwe]
jwe
parents: 4006
diff changeset
177 endfunction
8258
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
178
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
179 function update_props (h, d)
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
180 set (get (h, "children"), "color", get (h, "color"),
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
181 "linewidth", get (h, "linewidth"), "linestyle", get (h, "linestyle"),
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
182 "marker", get (h, "marker"), "markersize", get (h, "markersize"),
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
183 "markerfacecolor", get (h, "markerfacecolor"),
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
184 "markeredgecolor", get (h, "markeredgecolor"));
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
185 endfunction
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
186
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
187 function update_data (h, d)
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
188 x = get (h, "xdata");
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
189 y = get (h, "ydata");
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
190 l = get (h, "ldata");
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
191 u = get (h, "udata");
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
192 xl = get (h, "xldata");
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
193 xu = get (h, "xudata");
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
194
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
195 kids = get (h, "children");
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
196 set (kids(1), "xdata", x, "ydata", y);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
197 set (kids(2), "xdata", x, "ydata", y, "ldata", l, "udata", u,
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
198 "xldata", xl, "xudata", xu);
2b408bbd8904 Add error bar series
David Bateman <dbateman@free.fr>
parents: 7017
diff changeset
199 endfunction