5406
|
1 ## Copyright (C) 2005 John W. Eaton |
|
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 2, or (at your option) |
|
8 ## 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, write to the Free |
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
|
19 |
|
20 ## This is a script file shared by __plt__ and __errplot__. |
|
21 |
5493
|
22 ## global variables to keep track of multiplot options |
|
23 |
5406
|
24 global __current_figure__; |
|
25 global __plot_data_offset__; |
6146
|
26 global __plot_line_offset__; |
5406
|
27 global __plot_command__; |
|
28 global __plot_command_sep__; |
|
29 global __plot_data__; |
6146
|
30 global __plot_key_labels__; |
|
31 global __plot_key_properties__; |
6163
|
32 global __multiplot_mode__; |
|
33 global __multiplot_xsize__; |
|
34 global __multiplot_ysize__; |
|
35 global __multiplot_xn__; |
|
36 global __multiplot_yn__; |
|
37 global __multiplot_xi__; |
|
38 global __multiplot_yi__; |
5406
|
39 |
|
40 if (isempty (__current_figure__)) |
|
41 __current_figure__ = 1; |
|
42 endif |
|
43 |
6163
|
44 if (length (__multiplot_mode__) < __current_figure__) |
|
45 __multiplot_mode__(__current_figure__) = false; |
|
46 endif |
|
47 |
|
48 if (length (__multiplot_xsize__) < __current_figure__) |
|
49 __multiplot_xsize__(__current_figure__) = 1; |
|
50 endif |
|
51 |
|
52 if (length (__multiplot_ysize__) < __current_figure__) |
|
53 __multiplot_ysize__(__current_figure__) = 1; |
|
54 endif |
|
55 |
|
56 if (length (__multiplot_xn__) < __current_figure__) |
|
57 __multiplot_xn__(__current_figure__) = 1; |
|
58 endif |
|
59 |
|
60 if (length (__multiplot_yn__) < __current_figure__) |
|
61 __multiplot_yn__(__current_figure__) = 1; |
|
62 endif |
|
63 |
|
64 if (length (__multiplot_xi__) < __current_figure__) |
|
65 __multiplot_xi__(__current_figure__) = 1; |
|
66 endif |
|
67 |
|
68 if (length (__multiplot_yi__) < __current_figure__) |
|
69 __multiplot_yi__(__current_figure__) = 1; |
|
70 endif |
|
71 |
5493
|
72 if (length (__plot_data_offset__) < __current_figure__ |
6163
|
73 || any (size (__plot_data_offset__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)])) |
5406
|
74 |
6163
|
75 __plot_data_offset__{__current_figure__}(__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)) = 1; |
5406
|
76 endif |
|
77 |
6146
|
78 if (length (__plot_line_offset__) < __current_figure__ |
6163
|
79 || any (size (__plot_line_offset__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)])) |
6146
|
80 |
6163
|
81 __plot_line_offset__{__current_figure__}(__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)) = 1; |
6146
|
82 endif |
|
83 |
5493
|
84 if (length (__plot_command__) < __current_figure__ |
6163
|
85 || any (size (__plot_command__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)])) |
|
86 __plot_command__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)} = ""; |
5406
|
87 endif |
5493
|
88 |
|
89 if (length (__plot_data__) < __current_figure__ |
6163
|
90 || any (size (__plot_data__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)])) |
|
91 __plot_data__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)} = []; |
5493
|
92 endif |
6146
|
93 |
|
94 if (length (__plot_key_labels__) < __current_figure__ |
6163
|
95 || any (size (__plot_key_labels__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)])) |
|
96 __plot_key_labels__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)} = []; |
6146
|
97 endif |
|
98 |
|
99 if (length (__plot_key_properties__) < __current_figure__ |
6163
|
100 || any (size (__plot_key_properties__{__current_figure__}) != [__multiplot_xi__(__current_figure__), __multiplot_yi__(__current_figure__)])) |
|
101 __plot_key_properties__{__current_figure__}{__multiplot_xi__(__current_figure__),__multiplot_yi__(__current_figure__)} = struct ("visible", true, "box", false, "position", 0); |
6146
|
102 endif |