Functions | |
function | gnuplot_drawnow (h, term, file, mono, debug_file) if(nargin< 4) mono |
endif | if (nargin >=3 &&nargin<=5) plot_stream |
if (__gnuplot_has_feature__("variable_GPVAL_TERMINALS")) available_terminals | |
endif | if (gnuplot_supports_term)[enhanced |
__go_draw_figure__ (h, plot_stream(1), enhanced, mono, printing, implicit_margin) | |
if (nargin==5) fid | |
__go_draw_figure__ (h, fid, enhanced, mono, printing, implicit_margin) | |
endif else | error ("gnuplot_drawnow: the gnuplot terminal, \"%s\", is not available.", gnuplot_trim_term(term)) endif unwind_protect_cleanup set(h |
if (!isempty(plot_stream)) pclose(plot_stream(1)) | |
if (numel(plot_stream) > 1) pclose(plot_stream(2)) | |
endif | if (numel(plot_stream) > 2) waitpid(plot_stream(3)) |
endif endif | if (!isempty(fid)) fclose(fid) |
endif end_unwind_protect | elseif (nargin==1) plot_stream |
if (isempty(plot_stream)) plot_stream | |
__go_draw_figure__ (h, plot_stream(1), enhanced, mono, 0) | |
fflush (plot_stream(1)) | |
else | print_usage () |
if (strcmpi(term,"pdf")&&strcmpi(opts_str,"color")) opts_str | |
if (!isempty(term)) if(enhanced) enh_str | |
endif | if (!isempty(h)&&isfigure(h)) if(output_to_screen(term)) fig.numbertitle |
if (strcmpi(get(h,"numbertitle"),"on")) title_str | |
endif | if (!isempty(fig.name)&&!isempty(title_str)) title_str |
elseif (!isempty(fig.name)&&isempty(title_str)) title_str | |
endif | if (!isempty(title_str)) title_str |
endif | if (!(any(strfind(opts_str," size ") > 0)||any(strfind(opts_str,"size ")==1))) if(output_to_screen(term)) units |
unwind_protect_cleanup | set (h,"units", units) |
unwind_protect | set (h,"paperunits","inches") |
unwind_protect_cleanup | set (h,"paperunits", paperunits) |
end_unwind_protect | if (term_units_are_pixels(term)) gnuplot_size |
if (!any(strcmp(term, flickering_terms))||numel(findall(h,"type","axes")) > 1||numel(findall(h,"type","image")) > 0) fprintf(plot_stream | |
endif endif | fputs (plot_stream,"set multiplot;\n") |
elseif (any(strcmp(term, flickering_terms))) fprintf(plot_stream | |
if (isempty(term)) if(ismac()) term | |
elseif (!isunix()) term | |
if (isempty(n)) term | |
if (isempty(enhanced_terminals)) enhanced_terminals | |
endif | if (nargin< 1) term |
Variables | |
fid = [] | |
printing = ! output_to_screen (gnuplot_trim_term (term)) | |
default_plot_stream = get (h, "__plot_stream__") | |
unwind_protect | plot_stream = __gnuplot_open_stream__ (2, h) |
available_terminals = regexp (available_terminals, "\\b\\w+\\b", "match") | |
gnuplot_supports_term | |
endif | implicit_margin |
endif else | __plot_stream__ |
new_stream = true | |
endif | enhanced = gnuplot_set_term (plot_stream (1), new_stream, h) |
endif endfunction | function [enhanced, implicit_margin] |
opts_str = "" | |
else [term, opts_str] = gnuplot_trim_term (term) | |
else | enh_str = "" |
fig | name = get (h, "name") |
else | title_str = "" |
unwind_protect | set (h,"units","pixels") |
position_in_pixesl = get (h, "position") | |
end_unwind_protect | gnuplot_pos = position_in_pixesl(1:2) |
gnuplot_size = position_in_pixesl(3:4) | |
else | paperunits = get (h, "paperunits") |
endif | endif [begin_match, end_match, te, match] = regexp (opts_str, "(\\s-r\\d+)|(^-r\\d+)") |
if(!isempty(begin_match)) error("gnuplot_drawnow.m | n = strfind (string, ' ') |
flickering_terms = {"x11", "windows", "wxt"} | |
s | term_str |
set output | s |
file | |
endif endif endif else endif endfunction function | term |
opts = "" | |
endif endfunction function | have_enhanced |
endfunction function | ret |
__go_draw_figure__ | ( | h | , | |
fid | , | |||
enhanced | , | |||
mono | , | |||
printing | , | |||
implicit_margin | ||||
) |
__go_draw_figure__ | ( | h | , | |
plot_stream(1) | , | |||
enhanced | , | |||
mono | , | |||
printing | , | |||
implicit_margin | ||||
) |
elseif | ( | ! | isunix() | ) |
elseif | ( | any(strcmp(term, flickering_terms)) | ) |
elseif | ( | ! | isemptyfig.name)&&isempty(title_str | ) |
endif end_unwind_protect elseif | ( | nargin | = =1 |
) |
endif else error | ( | "gnuplot_drawnow: the gnuplot | terminal, | |
\"%s\" | , | |||
is not available." | , | |||
gnuplot_trim_term(term) | ||||
) |
fflush | ( | plot_stream(1) | ) |
function gnuplot_drawnow | ( | h | , | |
term | , | |||
file | , | |||
mono | , | |||
debug_file | ||||
) |
endif if | ( | ) |
if | ( | isempty(enhanced_terminals) | ) |
if | ( | isempty(n) | ) |
if | ( | isempty(term) | ) |
if | ( | ! | anystrcmp(term, flickering_terms))||numel(findall(h,"type","axes"), | |
1|| | numelfindall(h,"type","image"), | |||
0 | ||||
) |
end_unwind_protect if | ( | term_units_are_pixels(term) | ) |
endif if | ( | ! | any(strfind(opts_str," size ") > 0)||any(strfind(opts_str,"size ")==1) | ) |
endif if | ( | ! | isemptytitle_str | ) |
endif if | ( | ! | isemptyfig.name)&&!isempty(title_str | ) |
if | ( | strcmpi(get(h,"numbertitle"),"on") | ) |
endif if | ( | ! | isemptyh)&&isfigure(h | ) |
if | ( | ! | isemptyterm | ) |
if | ( | isempty(plot_stream) | ) |
endif if | ( | numel(plot_stream) | , | |
2 | ||||
) |
if | ( | numel(plot_stream) | , | |
1 | ||||
) |
if | ( | ! | isemptyplot_stream | ) |
if | ( | nargin | = = 5 |
) |
endif if | ( | gnuplot_supports_term | ) |
if | ( | __gnuplot_has_feature__("variable_GPVAL_TERMINALS") | ) |
else print_usage | ( | ) |
unwind_protect_cleanup set | ( | h | , | |
"paperunits" | , | |||
paperunits | ||||
) |
unwind_protect set | ( | h | , | |
"paperunits" | , | |||
"inches" | ||||
) |
unwind_protect_cleanup set | ( | h | , | |
"units" | , | |||
units | ||||
) |
available_terminals = regexp (available_terminals, "\\b\\w+\\b", "match") |
endif else default_plot_stream = get (h, "__plot_stream__") |
enhanced = gnuplot_set_term (plot_stream (1), new_stream, h) |
fid = [] |
flickering_terms = {"x11", "windows", "wxt"} |
Initial value:
gnuplot_set_term (plot_stream, new_stream, h, term, file) if (nargin < 4) term = gnuplot_default_term ()
else gnuplot_size = position_in_pixesl(3:4) |
Initial value:
any (strcmpi (available_terminals, gnuplot_trim_term (term)))
Initial value:
gnuplot_is_enhanced_term (term) persistent enhanced_terminals
Initial value:
gnuplot_set_term (plot_stream (1), true, h, term, file)
n = strfind (string, ' ') |
else new_stream = true |
opts = "" |
opts_str = "" |
endif paperunits = get (h, "paperunits") |
unwind_protect plot_stream = __gnuplot_open_stream__ (2, h) |
position_in_pixesl = get (h, "position") |
set output s |
unwind_protect set(h,"paperunits","inches") | ( | h | , | |
"units" | , | |||
"pixels" | ||||
) |
s term_str |