annotate scripts/plot/__plot_globals__.m @ 6163:8614649c454c

[project @ 2006-11-14 18:52:34 by jwe]
author jwe
date Tue, 14 Nov 2006 18:52:39 +0000
parents 1a6d826e92b5
children 17f25cd588b2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
1 ## Copyright (C) 2005 John W. Eaton
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
2 ##
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
4 ##
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
7 ## the Free Software Foundation; either version 2, or (at your option)
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
8 ## any later version.
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
9 ##
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
14 ##
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, write to the Free
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
18 ## 02110-1301, USA.
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
19
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
20 ## This is a script file shared by __plt__ and __errplot__.
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
21
5493
b2e882e8b68b [project @ 2005-10-13 17:51:19 by jwe]
jwe
parents: 5406
diff changeset
22 ## global variables to keep track of multiplot options
b2e882e8b68b [project @ 2005-10-13 17:51:19 by jwe]
jwe
parents: 5406
diff changeset
23
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
24 global __current_figure__;
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
25 global __plot_data_offset__;
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
26 global __plot_line_offset__;
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
27 global __plot_command__;
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
28 global __plot_command_sep__;
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
29 global __plot_data__;
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
30 global __plot_key_labels__;
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
31 global __plot_key_properties__;
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
32 global __multiplot_mode__;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
33 global __multiplot_xsize__;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
34 global __multiplot_ysize__;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
35 global __multiplot_xn__;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
36 global __multiplot_yn__;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
37 global __multiplot_xi__;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
38 global __multiplot_yi__;
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
39
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
40 if (isempty (__current_figure__))
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
41 __current_figure__ = 1;
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
42 endif
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
43
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
44 if (length (__multiplot_mode__) < __current_figure__)
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
45 __multiplot_mode__(__current_figure__) = false;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
46 endif
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
47
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
48 if (length (__multiplot_xsize__) < __current_figure__)
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
49 __multiplot_xsize__(__current_figure__) = 1;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
50 endif
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
51
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
52 if (length (__multiplot_ysize__) < __current_figure__)
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
53 __multiplot_ysize__(__current_figure__) = 1;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
54 endif
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
55
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
56 if (length (__multiplot_xn__) < __current_figure__)
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
57 __multiplot_xn__(__current_figure__) = 1;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
58 endif
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
59
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
60 if (length (__multiplot_yn__) < __current_figure__)
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
61 __multiplot_yn__(__current_figure__) = 1;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
62 endif
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
63
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
64 if (length (__multiplot_xi__) < __current_figure__)
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
65 __multiplot_xi__(__current_figure__) = 1;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
66 endif
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
67
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
68 if (length (__multiplot_yi__) < __current_figure__)
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
69 __multiplot_yi__(__current_figure__) = 1;
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
70 endif
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
71
5493
b2e882e8b68b [project @ 2005-10-13 17:51:19 by jwe]
jwe
parents: 5406
diff changeset
72 if (length (__plot_data_offset__) < __current_figure__
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
73 || any (size (__plot_data_offset__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)]))
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
74
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
75 __plot_data_offset__{__current_figure__}(__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)) = 1;
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
76 endif
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
77
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
78 if (length (__plot_line_offset__) < __current_figure__
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
79 || any (size (__plot_line_offset__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)]))
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
80
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
81 __plot_line_offset__{__current_figure__}(__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)) = 1;
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
82 endif
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
83
5493
b2e882e8b68b [project @ 2005-10-13 17:51:19 by jwe]
jwe
parents: 5406
diff changeset
84 if (length (__plot_command__) < __current_figure__
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
85 || any (size (__plot_command__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)]))
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
86 __plot_command__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)} = "";
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents:
diff changeset
87 endif
5493
b2e882e8b68b [project @ 2005-10-13 17:51:19 by jwe]
jwe
parents: 5406
diff changeset
88
b2e882e8b68b [project @ 2005-10-13 17:51:19 by jwe]
jwe
parents: 5406
diff changeset
89 if (length (__plot_data__) < __current_figure__
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
90 || any (size (__plot_data__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)]))
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
91 __plot_data__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)} = [];
5493
b2e882e8b68b [project @ 2005-10-13 17:51:19 by jwe]
jwe
parents: 5406
diff changeset
92 endif
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
93
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
94 if (length (__plot_key_labels__) < __current_figure__
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
95 || any (size (__plot_key_labels__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)]))
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
96 __plot_key_labels__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)} = [];
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
97 endif
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
98
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
99 if (length (__plot_key_properties__) < __current_figure__
6163
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
100 || any (size (__plot_key_properties__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)]))
8614649c454c [project @ 2006-11-14 18:52:34 by jwe]
jwe
parents: 6146
diff changeset
101 __plot_key_properties__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)} = struct ("visible", true, "box", false, "position", 0);
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 5493
diff changeset
102 endif