Mercurial > hg > octave-lyh
comparison scripts/plot/subplot.m @ 3426:f8dde1807dee
[project @ 2000-01-13 08:40:00 by jwe]
author | jwe |
---|---|
date | Thu, 13 Jan 2000 08:40:53 +0000 |
parents | a4cd1e9d9962 |
children | 22bd65326ec1 |
comparison
equal
deleted
inserted
replaced
3425:8625164a0a39 | 3426:f8dde1807dee |
---|---|
20 ## -*- texinfo -*- | 20 ## -*- texinfo -*- |
21 ## @deftypefn {Function File} {} subplot (@var{rows}, @var{cols}, @var{index}) | 21 ## @deftypefn {Function File} {} subplot (@var{rows}, @var{cols}, @var{index}) |
22 ## @deftypefnx {Function File} {} subplot (@var{rcn}) | 22 ## @deftypefnx {Function File} {} subplot (@var{rcn}) |
23 ## Sets @code{gnuplot} in multiplot mode and plots in location | 23 ## Sets @code{gnuplot} in multiplot mode and plots in location |
24 ## given by index (there are @var{cols} by @var{rows} subwindows). | 24 ## given by index (there are @var{cols} by @var{rows} subwindows). |
25 ## | 25 ## |
26 ## Input: | 26 ## Input: |
27 ## | 27 ## |
28 ## @table @var | 28 ## @table @var |
29 ## @item rows | 29 ## @item rows |
30 ## Number of rows in subplot grid. | 30 ## Number of rows in subplot grid. |
31 ## | 31 ## |
32 ## @item columns | 32 ## @item columns |
33 ## Number of columns in subplot grid. | 33 ## Number of columns in subplot grid. |
34 ## | 34 ## |
35 ## @item index | 35 ## @item index |
36 ## Index of subplot where to make the next plot. | 36 ## Index of subplot where to make the next plot. |
37 ## @end table | 37 ## @end table |
38 ## | 38 ## |
39 ## If only one argument is supplied, then it must be a three digit value | 39 ## If only one argument is supplied, then it must be a three digit value |
40 ## specifying the location in digits 1 (rows) and 2 (columns) and the plot | 40 ## specifying the location in digits 1 (rows) and 2 (columns) and the plot |
41 ## index in digit 3. | 41 ## index in digit 3. |
42 ## | 42 ## |
43 ## The plot index runs row-wise. First all the columns in a row are filled | 43 ## The plot index runs row-wise. First all the columns in a row are filled |
44 ## and then the next row is filled. | 44 ## and then the next row is filled. |
45 ## | 45 ## |
46 ## For example, a plot with 4 by 2 grid will have plot indices running as | 46 ## For example, a plot with 4 by 2 grid will have plot indices running as |
47 ## follows: | 47 ## follows: |
48 ## @iftex | 48 ## @iftex |
49 ## @tex | 49 ## @tex |
50 ## \vskip 10pt | 50 ## \vskip 10pt |
135 else | 135 else |
136 | 136 |
137 ## doing multiplot plots | 137 ## doing multiplot plots |
138 | 138 |
139 if (! __multiplot_mode__ | 139 if (! __multiplot_mode__ |
140 || __multiplot_xn__ != columns | 140 || __multiplot_xn__ != columns |
141 || __multiplot_yn__ != rows) | 141 || __multiplot_yn__ != rows) |
142 | 142 |
143 __multiplot_mode__ = 1; | 143 __multiplot_mode__ = 1; |
144 __multiplot_xn__ = columns; | 144 __multiplot_xn__ = columns; |
145 __multiplot_yn__ = rows; | 145 __multiplot_yn__ = rows; |
146 __multiplot_xsize__ = 1.0 ./ columns; | 146 __multiplot_xsize__ = 1.0 ./ columns; |
149 gnuplot_command_replot = "cle;rep"; | 149 gnuplot_command_replot = "cle;rep"; |
150 | 150 |
151 gset multiplot; | 151 gset multiplot; |
152 | 152 |
153 eval (sprintf ("gset size %g, %g", __multiplot_xsize__, | 153 eval (sprintf ("gset size %g, %g", __multiplot_xsize__, |
154 __multiplot_ysize__)); | 154 __multiplot_ysize__)); |
155 endif | 155 endif |
156 | 156 |
157 ## get the sub plot location | 157 ## get the sub plot location |
158 | 158 |
159 yp = fix ((index-1)/columns); | 159 yp = fix ((index-1)/columns); |