5837
|
1 ## Copyright (C) 1996 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 ## -*- texinfo -*- |
|
21 ## @deftypefn {Function File} {} __plt3__ (@var{x}, @var{y}, @var{z}, @var{fmt}) |
|
22 ## @end deftypefn |
|
23 |
|
24 ## Author: Paul Kienzle <kienzle.powernet.co.uk> |
|
25 ## 2001-04-06 Paul Kienzle <kienzle.powernet.co.uk> |
|
26 ## * __gnuplot_set__ nohidden3d; vector X,Y, matrix Z => meshgrid(X,Y) |
|
27 |
|
28 ## Modified to use new gnuplot interface in octave > 2.9.0 |
|
29 ## Dmitri A. Sergatskov <dasergatskov@gmail.com> |
|
30 ## April 18, 2005 |
|
31 ## Modified to use NaN as seperator for gnuplot, so multiple calls |
|
32 ## aren't needed. |
|
33 ## David Bateman <dbateman@free.fr> |
|
34 ## May 25, 2006 |
|
35 |
6146
|
36 function __plt3__ (x, usingstr, fmtstr, keystr, withstr) |
5837
|
37 |
6004
|
38 if (nargin < 2) |
6075
|
39 have_usingstr = false; |
6004
|
40 usingstr = ""; |
6076
|
41 else |
|
42 have_usingstr = true; |
6004
|
43 endif |
|
44 if (nargin < 3) |
|
45 fmtstr = ""; |
|
46 endif |
|
47 if (nargin < 4) |
6146
|
48 keystr = ""; |
|
49 endif |
|
50 if (nargin < 5) |
6004
|
51 withstr = ""; |
5837
|
52 endif |
|
53 |
6004
|
54 __plot_globals__; |
|
55 |
6146
|
56 cf = __current_figure__; |
|
57 mxi = __multiplot_xi__; |
|
58 myi = __multiplot_yi__; |
|
59 |
6004
|
60 __setup_plot__ ("__gnuplot_splot__"); |
|
61 |
6146
|
62 j = __plot_data_offset__{cf}(mxi,myi); |
|
63 loff = __plot_line_offset__{cf}(mxi,myi); |
|
64 loff1 = loff; |
6004
|
65 |
6146
|
66 __plot_data__{cf}{mxi,myi}{j} = x; |
|
67 __plot_key_labels__{cf}{mxi,myi}{loff1++} = keystr; |
|
68 |
|
69 if (! have_usingstr) |
|
70 usingstr = __make_using_clause__ (__plot_data__{cf}{mxi,myi}{j}); |
5837
|
71 endif |
|
72 |
6146
|
73 __plot_command__{cf}{mxi,myi} ... |
|
74 = sprintf ("%s%s __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d} %s %s %s __plot_key_labels__{__current_figure__}{__multiplot_xi__,__multiplot_yi__}{%d} %s", |
|
75 __plot_command__{cf}{mxi,myi}, |
|
76 __plot_command_sep__, j++, usingstr, fmtstr, |
|
77 gnuplot_command_title, loff++, withstr); |
|
78 __plot_command_sep__ = ",\\\n"; |
|
79 |
|
80 __plot_data_offset__{cf}(mxi,myi) = j; |
|
81 __plot_line_offset__{cf}(mxi,myi) = loff; |
5837
|
82 |
6004
|
83 if (__multiplot_mode__) |
|
84 __gnuplot_raw__ ("clear\n"); |
|
85 endif |
5837
|
86 |
6146
|
87 if (! strcmp (__plot_command__{cf}{mxi,myi}, "__gnuplot_splot__")) |
|
88 eval (__plot_command__{cf}{mxi,myi}); |
6004
|
89 endif |
5837
|
90 endfunction |