Mercurial > hg > octave-lyh
annotate scripts/plot/__go_draw_figure__.m @ 8232:c6e9ff62c64a
Fix subplot for column vector of children in figure
author | David Bateman <dbateman@free.fr> |
---|---|
date | Thu, 16 Oct 2008 16:23:14 -0400 |
parents | 62d90e049d4f |
children | 1f429086565c |
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 |
6895 | 19 ## Undocumented internal function. |
6405 | 20 |
21 ## Author: jwe | |
22 | |
7269 | 23 function __go_draw_figure__ (f, plot_stream, enhanced, mono) |
6405 | 24 |
7269 | 25 if (nargin == 4) |
6405 | 26 if (strcmp (f.type, "figure")) |
27 | |
28 ## Set figure properties here? | |
29 | |
30 kids = f.children; | |
31 nkids = length (kids); | |
32 | |
33 if (nkids > 0) | |
34 axes_count = 0; | |
35 for i = 1:nkids | |
7379 | 36 obj = __get__ (kids(i)); |
6405 | 37 switch (obj.type) |
38 case "axes" | |
39 axes_count++; | |
40 endswitch | |
41 endfor | |
42 | |
6619 | 43 fputs (plot_stream, "\nreset;\n"); |
7271 | 44 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
|
45 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
|
46 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
|
47 fputs (plot_stream, "set size 1, 1\n"); |
6405 | 48 |
49 for i = 1:nkids | |
50 obj = get (kids(i)); | |
51 switch (obj.type) | |
52 case "axes" | |
7269 | 53 __go_draw_axes__ (kids (i), plot_stream, enhanced, mono); |
6405 | 54 otherwise |
55 error ("__go_draw_figure__: unknown object class, %s", | |
56 obj.type); | |
57 endswitch | |
58 endfor | |
59 | |
8224
62d90e049d4f
Always use multiplot with gnuplot to ensure correct postscript bounding box
David Bateman <dbateman@free.fr>
parents:
8208
diff
changeset
|
60 fputs (plot_stream, "unset multiplot;\n"); |
6405 | 61 else |
6619 | 62 fputs (plot_stream, "\nreset; clear;\n"); |
6405 | 63 fflush (plot_stream); |
64 endif | |
65 else | |
66 error ("__go_draw_figure__: expecting figure object, found `%s'", | |
67 f.type); | |
68 endif | |
69 else | |
70 print_usage (); | |
71 endif | |
72 | |
73 endfunction | |
74 |