Mercurial > hg > octave-lyh
comparison scripts/plot/gnuplot_drawnow.m @ 9011:dd5725531732
gnuplot_drawnow.m: When printing, pass scalar plot_stream to __gnuplot_draw_figure__, and close all plot streams when done.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Tue, 24 Mar 2009 19:41:56 -0400 |
parents | 7a7cf569528d |
children | 8651fcc89556 |
comparison
equal
deleted
inserted
replaced
9010:f914834836e7 | 9011:dd5725531732 |
---|---|
50 gnuplot_supports_term = true; | 50 gnuplot_supports_term = true; |
51 endif | 51 endif |
52 if (gnuplot_supports_term) | 52 if (gnuplot_supports_term) |
53 [enhanced, implicit_margin] = gnuplot_set_term (plot_stream (1), true, | 53 [enhanced, implicit_margin] = gnuplot_set_term (plot_stream (1), true, |
54 h, term, file); | 54 h, term, file); |
55 __go_draw_figure__ (h, plot_stream, enhanced, mono, printing, implicit_margin); | 55 __go_draw_figure__ (h, plot_stream(1), enhanced, mono, printing, implicit_margin); |
56 if (nargin == 5) | 56 if (nargin == 5) |
57 fid = fopen (debug_file, "wb"); | 57 fid = fopen (debug_file, "wb"); |
58 [enhanced, implicit_margin] = gnuplot_set_term (fid, true, h, term, file); | 58 [enhanced, implicit_margin] = gnuplot_set_term (fid, true, h, term, file); |
59 __go_draw_figure__ (h, fid, enhanced, mono, printing, implicit_margin); | 59 __go_draw_figure__ (h, fid, enhanced, mono, printing, implicit_margin); |
60 endif | 60 endif |
62 error ("gnuplot_drawnow: the gnuplot terminal, \"%s\", is not available.", | 62 error ("gnuplot_drawnow: the gnuplot terminal, \"%s\", is not available.", |
63 gnuplot_trim_term (term)) | 63 gnuplot_trim_term (term)) |
64 endif | 64 endif |
65 unwind_protect_cleanup | 65 unwind_protect_cleanup |
66 if (! isempty (plot_stream)) | 66 if (! isempty (plot_stream)) |
67 pclose (plot_stream); | 67 pclose (plot_stream(1)); |
68 if (numel (plot_stream) == 2) | |
69 pclose (plot_stream(2)); | |
70 endif | |
68 endif | 71 endif |
69 if (! isempty (fid)) | 72 if (! isempty (fid)) |
70 fclose (fid); | 73 fclose (fid); |
71 endif | 74 endif |
72 end_unwind_protect | 75 end_unwind_protect |