2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
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 |
5307
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301, USA. |
1540
|
19 |
3368
|
20 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} mplot (@var{x}, @var{y}) |
|
22 ## @deftypefnx {Function File} {} mplot (@var{x}, @var{y}, @var{fmt}) |
|
23 ## @deftypefnx {Function File} {} mplot (@var{x1}, @var{y1}, @var{x2}, @var{y2}) |
|
24 ## This is a modified version of the @code{plot} function that works with |
3426
|
25 ## the multiplot version of @code{gnuplot} to plot multiple plots per page. |
3368
|
26 ## This plot version automatically advances to the next subplot position |
|
27 ## after each set of arguments are processed. |
3426
|
28 ## |
3368
|
29 ## See the description of the @var{plot} function for the various options. |
|
30 ## @end deftypefn |
1540
|
31 |
2312
|
32 ## Author: Vinayak Dutt <Dutt.Vinayak@mayo.EDU> |
|
33 ## Adapted-By: jwe |
1540
|
34 |
3979
|
35 function mplot (varargin) |
1540
|
36 |
6163
|
37 __plot_globals__; |
1540
|
38 |
6163
|
39 cf = __current_figure__; |
1540
|
40 |
5252
|
41 __gnuplot_raw__ ("set nologscale;\n"); |
|
42 __gnuplot_raw__ ("set nopolar;\n"); |
1540
|
43 |
3979
|
44 __plt__ ("plot", varargin{:}); |
1540
|
45 |
2303
|
46 ## update the plot position |
1540
|
47 |
6163
|
48 if (__multiplot_mode__(cf)) |
1540
|
49 |
6163
|
50 if (__multiplot_xi__(cf) < __multiplot_xn__(cf)) |
|
51 __multiplot_xi__(cf)++; |
1540
|
52 else |
6163
|
53 __multiplot_xi__(cf) = 1; |
|
54 if (__multiplot_yi__(cf) < __multiplot_yn__(cf)) |
|
55 __multiplot_yi__(cf)++; |
1540
|
56 else |
6163
|
57 __multiplot_yi__(cf) = 1; |
1540
|
58 endif |
|
59 endif |
|
60 |
6163
|
61 xo = (__multiplot_xi__(cf) - 1.0) * __multiplot_xsize__(cf); |
|
62 yo = (__multiplot_yn__(cf) - __multiplot_yi__(cf)) * __multiplot_ysize__(cf); |
1540
|
63 |
5252
|
64 __gnuplot_raw__ (sprintf ("set origin %g, %g;\n", xo, yo)); |
1540
|
65 |
|
66 endif |
|
67 |
|
68 endfunction |