Mercurial > hg > octave-lyh
annotate scripts/plot/__go_draw_figure__.m @ 8874:bd1b1fe9c6e9 ss-3-1-53
bump version info for snapshot
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 25 Feb 2009 18:35:47 -0500 |
parents | 7d48766c21a5 |
children | 665b264b6a50 |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 2005, 2007 John W. Eaton |
6405 | 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 | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
6405 | 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 | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
6405 | 18 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8249
diff
changeset
|
19 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8249
diff
changeset
|
20 ## @deftypefn {Function File} {} __go_draw_figure__ (@var{h}, @var{plot_stream}, @var{enhanced}, @var{mono}) |
6895 | 21 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8249
diff
changeset
|
22 ## @end deftypefn |
6405 | 23 |
24 ## Author: jwe | |
25 | |
8249 | 26 function __go_draw_figure__ (h, plot_stream, enhanced, mono) |
6405 | 27 |
7269 | 28 if (nargin == 4) |
8249 | 29 htype = get (h, "type"); |
30 if (strcmp (htype, "figure")) | |
6405 | 31 |
32 ## Set figure properties here? | |
33 | |
8249 | 34 ## Get complete list of children. |
35 kids = allchild (h); | |
6405 | 36 nkids = length (kids); |
37 | |
38 if (nkids > 0) | |
39 axes_count = 0; | |
40 for i = 1:nkids | |
7379 | 41 obj = __get__ (kids(i)); |
6405 | 42 switch (obj.type) |
43 case "axes" | |
44 axes_count++; | |
45 endswitch | |
46 endfor | |
47 | |
6619 | 48 fputs (plot_stream, "\nreset;\n"); |
7271 | 49 fputs (plot_stream, "set autoscale fix;\n"); |
8224
62d90e049d4f
Always use multiplot with gnuplot to ensure correct postscript bounding box
David Bateman <dbateman@free.fr>
parents:
8208
diff
changeset
|
50 fputs (plot_stream, "set multiplot;\n"); |
62d90e049d4f
Always use multiplot with gnuplot to ensure correct postscript bounding box
David Bateman <dbateman@free.fr>
parents:
8208
diff
changeset
|
51 fputs (plot_stream, "set origin 0, 0\n"); |
62d90e049d4f
Always use multiplot with gnuplot to ensure correct postscript bounding box
David Bateman <dbateman@free.fr>
parents:
8208
diff
changeset
|
52 fputs (plot_stream, "set size 1, 1\n"); |
6405 | 53 |
54 for i = 1:nkids | |
55 obj = get (kids(i)); | |
56 switch (obj.type) | |
57 case "axes" | |
7269 | 58 __go_draw_axes__ (kids (i), plot_stream, enhanced, mono); |
6405 | 59 otherwise |
60 error ("__go_draw_figure__: unknown object class, %s", | |
61 obj.type); | |
62 endswitch | |
63 endfor | |
64 | |
8224
62d90e049d4f
Always use multiplot with gnuplot to ensure correct postscript bounding box
David Bateman <dbateman@free.fr>
parents:
8208
diff
changeset
|
65 fputs (plot_stream, "unset multiplot;\n"); |
6405 | 66 else |
6619 | 67 fputs (plot_stream, "\nreset; clear;\n"); |
6405 | 68 fflush (plot_stream); |
69 endif | |
70 else | |
71 error ("__go_draw_figure__: expecting figure object, found `%s'", | |
8249 | 72 htype); |
6405 | 73 endif |
74 else | |
75 print_usage (); | |
76 endif | |
77 | |
78 endfunction | |
79 |