annotate scripts/plot/__go_draw_figure__.m @ 8249:1f429086565c

[mq]: hidden-children
author John W. Eaton <jwe@octave.org>
date Tue, 21 Oct 2008 14:06:25 -0400
parents 62d90e049d4f
children 7d48766c21a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
1 ## Copyright (C) 2005, 2007 John W. Eaton
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
2 ##
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
4 ##
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
8 ## your option) any later version.
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
9 ##
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
14 ##
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
17 ## <http://www.gnu.org/licenses/>.
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
18
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6619
diff changeset
19 ## Undocumented internal function.
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
20
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
21 ## Author: jwe
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
22
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 8224
diff changeset
23 function __go_draw_figure__ (h, plot_stream, enhanced, mono)
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
24
7269
3fade00a6ac7 [project @ 2007-12-07 19:26:20 by jwe]
jwe
parents: 7202
diff changeset
25 if (nargin == 4)
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 8224
diff changeset
26 htype = get (h, "type");
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 8224
diff changeset
27 if (strcmp (htype, "figure"))
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
28
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
29 ## Set figure properties here?
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
30
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 8224
diff changeset
31 ## Get complete list of children.
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 8224
diff changeset
32 kids = allchild (h);
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
33 nkids = length (kids);
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
34
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
35 if (nkids > 0)
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
36 axes_count = 0;
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
37 for i = 1:nkids
7379
a78c7bccda91 [project @ 2008-01-15 18:42:29 by jwe]
jwe
parents: 7271
diff changeset
38 obj = __get__ (kids(i));
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
39 switch (obj.type)
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
40 case "axes"
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
41 axes_count++;
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
42 endswitch
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
43 endfor
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
44
6619
b2b3b0509586 [project @ 2007-05-14 16:32:54 by jwe]
jwe
parents: 6438
diff changeset
45 fputs (plot_stream, "\nreset;\n");
7271
c18512d0ddb6 [project @ 2007-12-10 06:52:51 by jwe]
jwe
parents: 7269
diff changeset
46 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
47 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
48 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
49 fputs (plot_stream, "set size 1, 1\n");
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
50
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
51 for i = 1:nkids
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
52 obj = get (kids(i));
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
53 switch (obj.type)
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
54 case "axes"
7269
3fade00a6ac7 [project @ 2007-12-07 19:26:20 by jwe]
jwe
parents: 7202
diff changeset
55 __go_draw_axes__ (kids (i), plot_stream, enhanced, mono);
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
56 otherwise
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
57 error ("__go_draw_figure__: unknown object class, %s",
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
58 obj.type);
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
59 endswitch
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
60 endfor
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
61
8224
62d90e049d4f Always use multiplot with gnuplot to ensure correct postscript bounding box
David Bateman <dbateman@free.fr>
parents: 8208
diff changeset
62 fputs (plot_stream, "unset multiplot;\n");
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
63 else
6619
b2b3b0509586 [project @ 2007-05-14 16:32:54 by jwe]
jwe
parents: 6438
diff changeset
64 fputs (plot_stream, "\nreset; clear;\n");
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
65 fflush (plot_stream);
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
66 endif
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
67 else
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
68 error ("__go_draw_figure__: expecting figure object, found `%s'",
8249
1f429086565c [mq]: hidden-children
John W. Eaton <jwe@octave.org>
parents: 8224
diff changeset
69 htype);
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
70 endif
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
71 else
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
72 print_usage ();
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
73 endif
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
74
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
75 endfunction
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents:
diff changeset
76