Functions | |
function | __go_draw_figure__ (h, plot_stream, enhanced, mono, output_to_paper, implicit_margin) if(nargin< 5) output_to_paper |
elseif (nargin< 6) implicit_margin=0 | |
endif | if (nargin >=4 &&nargin<=6) htype |
if (strcmp(htype,"figure")) if(output_to_paper) orig_paper_units | |
unwind_protect_cleanup | set (h,"paperunits", orig_paper_units) |
end_unwind_protect | if (strcmp(gpval_term,"postscript")&&!isempty(strfind(gpval_termoptions,"landscape"))) implicit_margin(2) |
if (nkids > 0) fputs(plot_stream | |
fputs (plot_stream,"set autoscale keepfix;\n") | |
fputs (plot_stream,"set origin 0, 0\n") | |
fputs (plot_stream,"set size 1, 1\n") | |
switch (type) case"axes"orig_axes_units | |
unwind_protect | set (kids(i),"units","normalized") |
if (output_to_paper) axes_position_on_page | |
axes_position_on_page (1:2) | |
set (kids(i),"position", axes_position_on_page) | |
__go_draw_axes__ (kids(i), plot_stream, enhanced, mono, implicit_margin) | |
endif unwind_protect_cleanup | set (kids(i),"units", orig_axes_units) |
set (kids(i),"position", orig_axes_position) | |
end_unwind_protect otherwise | error ("__go_draw_figure__: unknown object class, %s", type) |
endswitch endfor else | fputs (plot_stream,"\nreset; clear;\n") |
fflush (plot_stream) | |
endif else | error ("__go_draw_figure__: expecting figure object, found `%s'", htype) |
endif else | print_usage () |
Variables | |
gpval_term = __gnuplot_get_var__ (h, "GPVAL_TERM") | |
gpval_termoptions = __gnuplot_get_var__ (h, "GPVAL_TERMOPTIONS") | |
unwind_protect | set (h,"paperunits","inches") |
paper_size = get (h, "papersize") | |
paper_position = get (h, "paperposition") | |
implicit_margin = implicit_margin ./ paper_size | |
endif | kids = allchild (h) |
nkids = length (kids) | |
nreset | |
n | |
for | i |
orig_axes_position = get (kids(i), "position") |
else __go_draw_axes__ | ( | kids(i) | , | |
plot_stream | , | |||
enhanced | , | |||
mono | , | |||
implicit_margin | ||||
) |
function __go_draw_figure__ | ( | h | , | |
plot_stream | , | |||
enhanced | , | |||
mono | , | |||
output_to_paper | , | |||
implicit_margin | ||||
) |
axes_position_on_page | ( | 1:2 | ) |
elseif | ( | ) | [pure virtual] |
end_unwind_protect otherwise error | ( | "__go_draw_figure__: unknown object | class, | |
%s" | , | |||
type | ||||
) |
fflush | ( | plot_stream | ) |
fputs | ( | plot_stream | , | |
"set size | 1, | |||
1\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set origin | 0, | |||
0\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set autoscale keepfix;\n" | ||||
) |
if | ( | output_to_paper | ) |
if | ( | nkids | , | |
0 | ||||
) |
end_unwind_protect if | ( | strcmp(gpval_term,"postscript")&&!isempty(strfind(gpval_termoptions,"landscape")) | ) |
if | ( | strcmp(htype,"figure") | ) |
set | ( | kids(i) | , | |
"position" | , | |||
orig_axes_position | ||||
) |
set | ( | kids(i) | , | |
"position" | , | |||
axes_position_on_page | ||||
) |
unwind_protect set | ( | kids(i) | , | |
"units" | , | |||
"normalized" | ||||
) |
unwind_protect_cleanup set | ( | h | , | |
"paperunits" | , | |||
orig_paper_units | ||||
) |
switch | ( | type | ) |
gpval_term = __gnuplot_get_var__ (h, "GPVAL_TERM") |
gpval_termoptions = __gnuplot_get_var__ (h, "GPVAL_TERMOPTIONS") |
n |
orig_axes_position = get (kids(i), "position") |
paper_position = get (h, "paperposition") |
paper_size = get (h, "papersize") |
unwind_protect set(kids(i),"units","normalized") | ( | h | , | |
"paperunits" | , | |||
"inches" | ||||
) |