Functions | |
function | __go_draw_axes__ (h, plot_stream, enhanced, mono, implicit_margin) if(nargin > |
unwind_protect_cleanup | set (0,"showhiddenhandles", showhiddenhandles) |
if (strcmp(axis_obj.tag,"plotyy")) ymirror | |
if (__gnuplot_has_feature__("screen_coordinates_for_{lrtb}margin")) if(strcmpi(axis_obj.dataaspectratiomode | |
endif | if (nd==2) x |
endif | fprintf (plot_stream,"set tmargin screen %.15g;\n", pos(2)+pos(4)/2+x(2)*pos(4)/2) |
fprintf (plot_stream,"set bmargin screen %.15g;\n", pos(2)+pos(4)/2-x(2)*pos(4)/2) | |
fprintf (plot_stream,"set lmargin screen %.15g;\n", pos(1)+pos(3)/2-x(1)*pos(3)/2) | |
fprintf (plot_stream,"set rmargin screen %.15g;\n", pos(1)+pos(3)/2+x(1)*pos(3)/2) | |
else | fprintf (plot_stream,"set tmargin 0;\n") |
fprintf (plot_stream,"set bmargin 0;\n") | |
fprintf (plot_stream,"set lmargin 0;\n") | |
fprintf (plot_stream,"set rmargin 0;\n") | |
fprintf (plot_stream,"set origin %.15g, %.15g;\n", pos(1), pos(2)) | |
fprintf (plot_stream,"set size %.15g, %.15g;\n", pos(3), pos(4)) | |
if (strcmpi(axis_obj.dataaspectratiomode,"manual")) r | |
fprintf (plot_stream,"set size ratio %.15g;\n",-r(2)/r(1)) | |
else | fputs (plot_stream,"set size noratio;\n") |
endif endif | fputs (plot_stream,"unset label;\n") |
fputs (plot_stream,"unset xtics;\n") | |
fputs (plot_stream,"unset ytics;\n") | |
fputs (plot_stream,"unset ztics;\n") | |
fputs (plot_stream,"unset x2tics;\n") | |
if (!isempty(axis_obj.title)) t | |
if (isempty(t.string)) fputs(plot_stream | |
fprintf (plot_stream,"set title \"%s\" %s %s", undo_string_escapes(tt), fontspec, __do_enhanced_option__(enhanced, t)) | |
pos (4)/5) | |
else | fprintf (plot_stream,";\n") |
endif endif endif | if (!isempty(axis_obj.xlabel)) t |
fprintf (plot_stream,"unset x2label;\n") | |
if (strcmpi(axis_obj.xaxislocation,"top")) fprintf(plot_stream | |
set x2label s s s | undo_string_escapes (tt) |
set x2label s s s | __do_enhanced_option__ (enhanced, t)) |
else | fprintf (plot_stream,"set xlabel \"%s\" %s %s %s", undo_string_escapes(tt), colorspec, fontspec, __do_enhanced_option__(enhanced, t)) |
endif | fprintf (plot_stream," rotate by %f;\n", angle) |
endif endif endif | if (!isempty(axis_obj.ylabel)) t |
fprintf (plot_stream,"unset y2label;\n") | |
if (strcmpi(axis_obj.yaxislocation,"right")) fprintf(plot_stream | |
else | fprintf (plot_stream,"set ylabel \"%s\" %s %s %s", undo_string_escapes(tt), colorspec, fontspec, __do_enhanced_option__(enhanced, t)) |
endif endif endif | if (!isempty(axis_obj.zlabel)) t |
fprintf (plot_stream,"set zlabel \"%s\" %s %s %s", undo_string_escapes(tt), colorspec, fontspec, __do_enhanced_option__(enhanced, t)) | |
if (strcmpi(axis_obj.xaxislocation,"zero")) fputs(plot_stream | |
if (strcmpi(axis_obj.yaxislocation,"zero")) fputs(plot_stream | |
if (strcmpi(axis_obj.xgrid,"on")) have_grid | |
fprintf (plot_stream,"set grid %stics;\n", xaxisloc) | |
else | fprintf (plot_stream,"set grid no%stics;\n", xaxisloc) |
endif | if (strcmpi(axis_obj.ygrid,"on")) have_grid |
fprintf (plot_stream,"set grid %stics;\n", yaxisloc) | |
else | fprintf (plot_stream,"set grid no%stics;\n", yaxisloc) |
endif | if (strcmpi(axis_obj.zgrid,"on")) have_grid |
fputs (plot_stream,"set grid ztics;\n") | |
else | fputs (plot_stream,"set grid noztics;\n") |
endif | if (strcmpi(axis_obj.xminorgrid,"on")) have_grid |
if (strcmp(axis_obj.xscale,"log")) m | |
endif | fprintf (plot_stream,"set m%stics %d;\n", xaxisloc, m) |
fprintf (plot_stream,"set grid m%stics;\n", xaxisloc) | |
else | fprintf (plot_stream,"set grid nom%stics;\n", xaxisloc) |
endif | if (strcmpi(axis_obj.yminorgrid,"on")) have_grid |
if (strcmp(axis_obj.yscale,"log")) m | |
endif | fprintf (plot_stream,"set m%stics %d;\n", yaxisloc, m) |
fprintf (plot_stream,"set grid m%stics;\n", yaxisloc) | |
else | fprintf (plot_stream,"set grid nom%stics;\n", yaxisloc) |
endif | if (strcmpi(axis_obj.zminorgrid,"on")) have_grid |
if (strcmp(axis_obj.zscale,"log")) m | |
endif | fprintf (plot_stream,"set mztics %d;\n", m) |
fputs (plot_stream,"set grid mztics;\n") | |
else | fputs (plot_stream,"set grid nomztics;\n") |
endif | if (strcmpi(axis_obj.layer,"top")) fputs(plot_stream |
fputs (plot_stream,"set border front;\n") | |
else | fputs (plot_stream,"set grid layerdefault;\n") |
fputs (plot_stream,"set border back;\n") | |
endif | if (!have_grid) fputs(plot_stream |
endif | do_tics (axis_obj, plot_stream, ymirror, mono, gnuplot_term) |
if (xlogscale) fprintf(plot_stream | |
else | fprintf (plot_stream,"unset logscale %s;\n", xaxisloc) |
if (ylogscale) fprintf(plot_stream | |
else | fprintf (plot_stream,"unset logscale %s;\n", yaxisloc) |
if (zlogscale) fputs(plot_stream | |
else | fputs (plot_stream,"unset logscale z;\n") |
fputs (plot_stream,"set clip two;\n") | |
fputs (plot_stream,"set style data lines;\n") | |
fputs (plot_stream,"set surface;\n") | |
fputs (plot_stream,"unset contour;\n") | |
if (!cautoscale &&clim(1)==clim(2)) clim(2)++ | |
while (!isempty(kids)) obj | |
if (strcmpi(obj.visible,"off")) continue | |
switch (obj.type) case"image"img_data | |
if (use_gnuplot_for_images) if(ndims(img_data) | |
elseif (strcmpi(obj.cdatamapping,"direct")) cdatadirect | |
is_image_data (data_idx) | |
parametric (data_idx) | |
have_cdata (data_idx) | |
have_3d_patch (data_idx) | |
if (x_dim > 1) dx | |
endif | if (y_dim > 1) dy |
if (ndims(img_data)==3) data | |
endif case line | if (strncmp(obj.linestyle,"none", 4)&&(!isfield(obj,"marker")||(isfield(obj,"marker")&&strncmp(obj.marker,"none", 4)))) continue |
if (isempty(obj.keylabel)) titlespec | |
if (!isempty(obj.zdata)) zdat | |
if (!isempty(ldat)) yerr | |
if (!isempty(udat)) udat | |
if (!isempty(xldat)) xerr | |
if (!isempty(xudat)) xudat | |
endif | if (yerr) if(isempty(ldat)) ylo |
endif | if (isempty(udat)) yhi |
endif | if (xerr) if(isempty(xldat)) xlo |
endif | if (isempty(xudat)) xhi |
endif | elseif (xerr) if(isempty(xldat)) xlo |
if (length(style) > 1) data_idx++ | |
endif | if (length(style) > 2) data_idx++ |
if (!isempty(obj.cdata)) cdat | |
if (strcmpi(obj.cdatamapping,"direct")) cdatadirect | |
endif endif | if (!isnan(xcol)&&!isnan(ycol)) if(strncmp(obj.facecolor |
else | if (isnan(hidden_removal)) hidden_removal |
else | if (isnan(data_3d_idx)) data_idx++ |
endif | if (i > 1||isempty(obj.keylabel)) titlespec |
endif | if (isfield(obj,"facecolor")) if((strncmp(obj.facecolor |
endif | strncmp (obj.facecolor,"interp", 6))&&isfield(obj |
endif cdata | if (ndims(obj.cdata)==2 &&(size(obj.cdata, 2)==nc &&(size(obj.cdata, 1)==1||size(obj.cdata, 1)==3))) ccol |
elseif (ndims(obj.cdata)==2 &&(size(obj.cdata, 1)==nc &&(size(obj.cdata, 2)==1||size(obj.cdata, 2)==3))) ccol = permute (cdat (:, i, :), [1, 3, 2]) | |
endif | if (strncmp(obj.facecolor,"flat", 4)) if(numel(ccol) |
elseif (nd==3 &&numel(xcol)==3) ccdat | |
endif | elseif (strncmp(obj.facecolor,"interp", 6)) if(nd |
if (!isvector(ccdat)) tmp | |
endif else | warning ("\"interp\" not supported, using 1st entry of cdata") |
endif endif | elseif (isnumeric(obj.facecolor)) color |
reshape (color, 1, 3)] | |
else | if (mono) colorspec |
elseif (__gnuplot_has_feature__("transparent_patches")&&isscalar(obj.facealpha)) colorspec | |
endif endif endif | if (!strncmp(obj.edgecolor,"none", 4)) data_idx++ |
if (isfield(obj,"markersize")) mdat | |
endif | if (isfield(obj,"edgecolor")) if((strncmp(obj.edgecolor |
endif | if (strncmp(obj.edgecolor,"flat", 4)) if(numel(ccol) |
endif | elseif (strncmp(obj.edgecolor,"interp", 6)) warning("\"interp\" not supported |
endif | elseif (isnumeric(obj.edgecolor)) color |
endif | if (isfield(obj,"linestyle")) switch(obj.linestyle) case"-"lt |
id | lt () |
endif | if (isfield(obj,"linewidth")) lw |
endif | if (isfield(obj,"marker")) if(isfield(obj |
zz (:, kk+1) | |
endif | if (withpm3d &&strncmp(style{1},"linespoints", 11)) if(isempty(zz)) len |
if (strcmpi(units,"normalized")) units | |
endif | if (isnumeric(color)) colorspec |
undo_string_escapes (label) | |
lpos (1) | |
lpos (2) | |
lpos (3) | |
__do_enhanced_option__ (enhanced, obj) | |
else | fprintf (plot_stream,"set label \"%s\" at %s %.15g,%.15g %s rotate by %f %s %s front %s;\n", undo_string_escapes(label), units, lpos(1), lpos(2), halign, angle, fontspec, __do_enhanced_option__(enhanced, obj), colorspec) |
endif case hggroup | if (isempty(kids)) kids |
elseif (!isempty(obj.children)) kids | |
endif otherwise | error ("__go_draw_axes__: unknown object class, %s", obj.type) |
else | fputs (plot_stream,"set pm3d explicit;\n") |
endif | if (isnan(hidden_removal)||hidden_removal) fputs(plot_stream |
else | fputs (plot_stream,"unset hidden3d;\n") |
if (isempty(xlim)) return | |
endif | if (strcmpi(axis_obj.xdir,"reverse")) xdir |
endif | fprintf (plot_stream,"set xrange [%.15e:%.15e] %s;\n", xlim, xdir) |
endif | if (isempty(ylim)) return |
endif | if (strcmpi(axis_obj.ydir,"reverse")) ydir |
endif | fprintf (plot_stream,"set yrange [%.15e:%.15e] %s;\n", ylim, ydir) |
endif | if (strcmpi(axis_obj.zdir,"reverse")) zdir |
endif | fprintf (plot_stream,"set zrange [%.15e:%.15e] %s;\n", zlim, zdir) |
if (!any(isinf(clim))) if(truecolor||!cdatadirect) if(rows(addedcmap) > 0) for i | |
endif endfor | fprintf (plot_stream,"set cbrange [%g:%g];\n", clim(1), clim(2)*(cmap_sz+rows(addedcmap))/cmap_sz) |
else | fprintf (plot_stream,"set cbrange [%g:%g];\n", clim) |
endif else | fprintf (plot_stream,"set cbrange [1:%d];\n", cmap_sz+rows(addedcmap)) |
endif endif | if (strcmpi(axis_obj.box,"on")) if(nd |
else | fputs (plot_stream,"set border 431;\n") |
fputs (plot_stream,"set border 12;\n") | |
else | fprintf (plot_stream,"unset x2tics; set xtics %s nomirror\n", axis_obj.tickdir) |
fputs (plot_stream,"set border 9;\n") | |
endif else | fprintf (plot_stream,"unset y2tics; set ytics %s nomirror\n", axis_obj.tickdir) |
fputs (plot_stream,"set border 6;\n") | |
fputs (plot_stream,"set border 3;\n") | |
endif endif endif endif | if (strcmpi(axis_obj.visible,"off")) fputs(plot_stream |
else | fprintf (plot_stream,"set border lw %f;\n", axis_obj.linewidth) |
endif | if (strcmpi(axis_obj.key,"on")) if(strcmpi(axis_obj.keybox |
endif | if (strcmpi(axis_obj.keyreverse,"on")) reverse |
if (ischar(keypos)) keypos | |
if (!isempty(keyout)) inout | |
endif endif | switch (keypos) case-1 pos |
warning ("legend: 'Best' not yet implemented for location specifier.\n") | |
endswitch | if (__gnuplot_has_feature__("key_has_font_properties")) fontspec |
endif | fprintf (plot_stream,"set key %s %s %s %s %s;\n", inout, pos, box, reverse, fontspec) |
else | fputs (plot_stream,"unset key;\n") |
if (length(cmap) > 0) fprintf(plot_stream | |
fprintf (plot_stream,"set palette file \"-\" binary record=%d using 1:2:3:4;\n", cmap_sz) | |
fwrite (plot_stream,[1:cmap_sz;cmap.'],"float32") | |
fwrite (plot_stream,"\n") | |
endif | fputs (plot_stream,"unset colorbox;\n") |
if (have_data) if(nd | |
while (rot_z< 0) rot_z+ | |
endwhile | fputs (plot_stream,"set ticslevel 0;\n") |
if (view_map &&rot_x==0 &&rot_z==0) fputs(plot_stream | |
else | fprintf (plot_stream,"set view %.15g, %.15g;\n", rot_x, rot_z) |
endif endif | if (have_3d_patch(1)) fputs(plot_stream |
fprintf (plot_stream,"%s \"-\" %s %s %s \\\n", plot_cmd, usingclause{1}, titlespec{1}, withclause{1}) | |
elseif (is_image_data(1)) fprintf(plot_stream | |
id | usingclause () |
elseif (is_image_data(i)) if(!is_image_data(i-1)) fputs(plot_stream | |
elseif (is_image_data(i-1)) fprintf(plot_stream | |
else | fprintf (plot_stream,", \"-\" binary format='%%float64' %s %s %s \\\n", usingclause{i}, titlespec{i}, withclause{i}) |
endif endfor | fputs (plot_stream,";\n") |
endif | fprintf (plot_stream,"%.15g %.15g %.15g %.15g\n", data{i}(:, j).') |
fprintf (plot_stream,"%.15g %.15g %.15g %.15g\n\n", data{i}(:, j+1).') | |
endfor | fputs (plot_stream,"e\n") |
else | __gnuplot_write_data__ (plot_stream, data{i}, nd, parametric(i), have_cdata(i)) |
endif endfor else | fputs (plot_stream,"plot \"-\";\nInf Inf\ne\n") |
endif | if (view_map) fputs(plot_stream |
endif | fflush (plot_stream) |
else | print_usage () |
fprintf (plot_stream,"set style line %d default;\n", idx) | |
fprintf (plot_stream,"set style line %d", idx) | |
if (isnumeric(linecolor)) color | |
linecolor rgb | round (255 *color)) |
endif | if (!isempty(errbars)) found_style |
if (strcmp(mtics,"on")) fprintf(plot_stream | |
else | fprintf (plot_stream,"unset m%stics;\n", ax) |
endif else | error ("unsupported type of ticklabel") |
endif else | fprintf (plot_stream,"set format %s \"%s\";\n", ax, fmt) |
if (mirror) fprintf(plot_stream | |
set stics s s s | mirror (", ax, tickdir, ticklength, axispos); else fprintf (plot_stream, "set%stics%s%s%s nomirror(", ax, tickdir, ticklength, axispos); endif fprintf (plot_stream, "%.15g,", tics(1:end-1)); fprintf (plot_stream, "%.15g)%s;\n", tics(end), fontspec); if (strcmp (mtics, "on")) fprintf (plot_stream, "set m%stics%d;\n", ax, num_mtics); else fprintf (plot_stream, "unset m%stics;\n", ax); endif endif else fprintf (plot_stream, "set format%s\"%s\";\n", ax, fmt) |
else | fprintf (plot_stream,"set %stics %s %s %s nomirror %s %s;\n", ax, tickdir, ticklength, axispos, colorspec, fontspec) |
endif | if (ischar(ticklabel)) if(size(ticklabel |
endif | elseif (isempty(ticklabel)) ticklabel |
if (!isempty(t.fontweight)&&strcmpi(t.fontweight,"bold")) if(!isempty(t.fontangle)&&(strcmpi(t.fontangle | |
italic | strcmpi (t.fontangle,"oblique"))) f |
endif | elseif (!isempty(t.fontangle)&&(strcmpi(t.fontangle,"italic")||strcmpi(t.fontangle,"oblique"))) f |
endif | if (isempty(t.fontsize)) s |
if (strcmp(fld,"string"))[f | |
if (enhanced) if(strcmpi(obj.interpreter | |
elseif (strcmpi(obj.interpreter,"latex")) if(!warned_latex) warning("latex markup not supported for text objects") | |
if (isfield(sym, f)) g | |
elseif (strncmp(f,"rm", 2)) bld | |
elseif (strncmp(f,"it", 2)||strncmp(f,"sl", 2)) it | |
if (bld) str | |
endif | elseif (strncmp(f,"bf", 2)) bld |
if (it) str | |
endif | elseif (strcmpi(f,"color")) d |
if (isempty(d)) warning('syntax error in\color argument') | |
endif | elseif (strcmpi(f,"fontname")) b1 |
if (isempty(b1)||isempty(b2)) warning('syntax error in\fontname argument') | |
endif | elseif (strcmpi(f,"fontsize")) b1 |
while (li<=length(l1)&&si<=length(s1)) if(l1(li)< s1(si)) if(li | |
if (s(i)+l1+1==s(i+1)) if(str(s(i+1)+p+1) | |
while (li<=length(l2)&&si<=length(s2)) if(l2(li)< s2(si)) if(li | |
if (length_string(str(s(i)+p+2:s(i)+p+l1-1))<=length_string(str(s(i+1)+p+2:s(i+1)+p+l2-1))) str | |
endif else | if (s(i+1)==s(i)+2) str |
if (!isempty(m)) l | |
elseif (isequal(color,[1, 0, 0])) typ | |
elseif (isequal(color,[0, 1, 0])) typ | |
elseif (isequal(color,[0, 0, 1])) typ | |
elseif (isequal(color,[1, 0, 1])) typ | |
elseif (isequal(color,[0, 1, 1])) typ | |
elseif (isequal(color,[1, 1, 1])) typ | |
elseif (isequal(color,[1, 1, 0])) typ | |
Variables | |
unwind_protect | set (0,"showhiddenhandles","on") |
axis_obj = __get__ (h) | |
end_unwind_protect | parent_figure_obj = get (axis_obj.parent) |
gnuplot_term = __gnuplot_get_var__ (axis_obj.parent, "GPVAL_TERM") | |
else | ymirror = true |
endif | nd = __calc_dimensions__ (axis_obj) |
pos = axis_obj.position | |
else | x = 1.0 ./ sqrt([2, 2.5]) |
unset | title |
n | |
else [tt, f, s] = __maybe_munge_text__ (enhanced, t, "string") | |
fontspec = create_fontspec (f, s, gnuplot_term) | |
offset | screen |
angle = t.rotation | |
colorspec = get_text_colorspec (axis_obj.xcolor, mono) | |
unset | xlabel |
set x2label s s s | s = t.fontsize |
unset | ylabel |
unset | zlabel |
xaxisloc_using = "x2" | |
else | xaxisloc = "x" |
set | xzeroaxis |
yaxisloc_using = "y2" | |
else | yaxisloc = "y" |
set | yzeroaxis |
endif endif | have_grid = false |
else | m = 5 |
endif set grid | front |
endif unset | grid |
xlogscale = strcmpi (axis_obj.xscale, "log") | |
endif | ylogscale = strcmpi (axis_obj.yscale, "log") |
endif | zlogscale = strcmpi (axis_obj.zscale, "log") |
set logscale | z |
endif | xautoscale = strcmpi (axis_obj.xlimmode, "auto") |
yautoscale = strcmpi (axis_obj.ylimmode, "auto") | |
zautoscale = strcmpi (axis_obj.zlimmode, "auto") | |
cautoscale = strcmpi (axis_obj.climmode, "auto") | |
cdatadirect = false | |
truecolor = false | |
kids = axis_obj.children | |
set | parametric |
endif | data_idx = 0 |
data = cell () | |
is_image_data = [] | |
hidden_removal = NaN | |
view_map = false | |
xlim = axis_obj.xlim | |
ylim = axis_obj.ylim | |
zlim = axis_obj.zlim | |
clim = axis_obj.clim | |
endif | addedcmap = [] |
use_gnuplot_for_images | |
ximg_data = {} | |
ximg_data_idx = 0 | |
endif | doing_interp_color |
img_xdata = obj.xdata | |
img_ydata = obj.ydata | |
else | x_dim = 2 |
img_data = [img_data, img_data] | |
dx = abs (img_xdata(2)-img_xdata(1)) | |
else | y_dim = 2 |
dy = abs (img_ydata(2)-img_ydata(1)) | |
endif | x_origin = min (img_xdata) |
y_origin = min (img_ydata) | |
format = permute (img_data, [3, 1, 2])(:) "1:2:3" | |
imagetype = "rgbimage" | |
else | tmp = "title \"\"" undo_string_escapes (__maybe_munge_text__ (enhanced, obj, "keylabel")) |
errbars = "" | |
ydat = obj.ydata(:) | |
else | zdat = zeros (size (xdat)) |
else | xdat = obj.xdata(:) |
ldat = obj.ldata | |
yerr = xerr = false | |
endif | udat = obj.udata |
endif | xldat = obj.xldata |
endif | xudat = obj.xudata |
else | ylo = ydat-ldat |
else | yhi = ydat+udat |
else | xlo = xdat-xldat |
else | xhi = xdat+xudat |
endif endif | style |
endif case patch | cmap = parent_figure_obj.colormap |
endif else | cdat = [] |
endif | data_3d_idx = NaN |
for | i |
ycol = obj.ydata(:,i) | |
else | zcol = zeros (size (xcol)) |
endif endif | none |
endif | local_idx = data_3d_idx |
ccdat = NaN | |
endif | flat |
else | ccol = cdat |
else | r |
color = cmap(r, :) | |
case | __pad4__ |
case none | lt = "" |
else | lw = "" |
case o | pt = "pt 6" |
case<"pt="pt10";case{"pentagram","p"}pt="pt4";case{"hexagram","h"}pt="pt12";case"none"pt="";otherwisept="";endswitchendifelsept="";endifstyle="lines";if(isempty(lt))if(!isempty(pt))style="points";endifelseif(!isempty(pt))style="linespoints";endifif(isfield(obj,"markersize"))if(length(mdat)==nc)m=mdat(i);elsem=mdat;endifif(!strcmpi(style,"lines"))ps=sprintf("pointsize%f",m);elseps="";endifelseps="";endifif(mono)colorspec="";elsecolorspec=sprintf("lcrgb\"#%02x%02x%02x\"", round(255 *color));endifwithclause{data_idx}=sprintf("with%s%s%s%s%s%s", style, lw, pt, lt, ps, colorspec);if(nd==3) if(!isnan(xcol)&&!isnan(ycol)&&!isnan(zcol)) data{data_idx}= | len [[xcol;xcol(1)],[ycol;ycol(1)],...[zcol;zcol(1)]]';elsedata{data_idx}=[xcol, ycol, zcol]';endifusingclause{data_idx}=sprintf("record=%dusing($1):($2):($3)", columns(data{data_idx}));elseif(!isnan(xcol)&&!isnan(ycol)) data{data_idx}=[[xcol;xcol(1)],[ycol;ycol(1)]]';elsedata{data_idx}=[xcol, ycol]';endifusingclause{data_idx}=sprintf("record=%dusing($1):($2)", columns(data{data_idx}));endifendifendforcase"surface"view_map=true;if(!(strncmp(obj.edgecolor,"none", 4)&&strncmp(obj.facecolor,"none", 4))) data_idx++;is_image_data(data_idx)=false;parametric(data_idx)=false;have_cdata(data_idx)=true;have_3d_patch(data_idx)=false;style=do_linestyle_command(obj, obj.edgecolor, data_idx, mono, plot_stream);if(isempty(obj.keylabel)) titlespec{data_idx}="title\"\"";elsetmp=undo_string_escapes(__maybe_munge_text__(enhanced, obj,"keylabel"));titlespec{data_idx}=cstrcat("title\"", tmp,"\"");endifwithclause{data_idx}=sprintf("withpm3dlinestyle%d", data_idx);withpm3d=true;pm3didx=data_idx;xdat=obj.xdata;ydat=obj.ydata;zdat=obj.zdata;cdat=obj.cdata;err=false;if(!size_equal(zdat, cdat)) err=true;endifif(isvector(xdat)&&isvector(ydat)&&ismatrix(zdat)) if(rows(zdat)==length(ydat)&&columns(zdat)==length(xdat))[xdat, ydat]=meshgrid(xdat, ydat);elseerr=true;endifelseif(ismatrix(xdat)&&ismatrix(ydat)&&ismatrix(zdat)) if(!size_equal(xdat, ydat, zdat)) err=true;endifelseerr=true;endifif(err) error("__go_draw_axes__:invalidgriddata");endifxlen=columns(zdat);ylen=rows(zdat);if(xlen==columns(xdat)&&xlen==columns(ydat)&&ylen==rows(xdat)&&ylen==rows(ydat)) len=4 *xlen;zz=zeros(ylen, len);k=1;forkk=1:4:lenzz(:, kk)=xdat(:, k);zz(:, kk+1)=ydat(:, k);zz(:, kk+2)=zdat(:, k);zz(:, kk+3)=cdat(:, k);k++;endfordata{data_idx}=zz.';endifif(doing_interp_color) interp_str="interpolate0,0";elseinterp_str="";endifusingclause{data_idx}=sprintf("record=%dx%dusing($1):($2):($3):($4)", ylen, xlen);flat_interp_face=(strncmp(obj.facecolor,"flat", 4)||strncmp(obj.facecolor,"interp", 6));flat_interp_edge=(strncmp(obj.edgecolor,"flat", 4)||strncmp(obj.edgecolor,"interp", 6));facecolor_none_or_white=(strncmp(obj.facecolor,"none", 4)||(isnumeric(obj.facecolor)&&all(obj.facecolor==1)));hidden_removal=false;fputs(plot_stream,"setstyleincrementdefault;\n");if(flat_interp_edge &&facecolor_none_or_white) withpm3d=false;withclause{data_idx}=sprintf("with%spalette", style{1});fputs(plot_stream,"unsetpm3d\n");if(all(obj.facecolor==1)) hidden_removal=true;endifelseif(facecolor_none_or_white) if(all(obj.facecolor==1)) hidden_removal=true;endiffputs(plot_stream,"unsetpm3d;\n");fputs(plot_stream,"setstyleincrementuser;\n");withpm3d=false;withclause{data_idx}=sprintf("with%slinestyle%d", style{1}, data_idx);fputs(plot_stream,"unsetpm3d\n");endifif(doing_interp_color) dord="scansautomatic";elsedord="depthorder";endifif(flat_interp_face &&strncmp(obj.edgecolor,"flat", 4)) fprintf(plot_stream,"setpm3dexplicitats%s%scorners2colorc3;\n", interp_str, dord);elseif(!facecolor_none_or_white) if(strncmp(obj.edgecolor,"none", 4)) if(__gnuplot_has_feature__("transparent_surface")&&isscalar(obj.facealpha)) fprintf(plot_stream,"setstylefilltransparentsolid%f;\n", obj.facealpha);endiffprintf(plot_stream,"setpm3dexplicitats%scorners2colorc3;\n", interp_str, dord);elsefprintf(plot_stream,"setpm3dexplicitatshidden3d%d%s%scorners2colorc3;\n", data_idx, interp_str, dord);if(__gnuplot_has_feature__("transparent_surface")&&isscalar(obj.facealpha)) fprintf(plot_stream,"setstylefilltransparentsolid%f;\n", obj.facealpha);endifendifendifzz=[];if(length(style)> = 3 * xlen |
zz = zeros (ylen, len) | |
k = 1 | |
for | kk |
endif endif case | text [label, f, s] = __maybe_munge_text__ (enhanced, obj, "string") |
lpos = obj.position | |
halign = obj.horizontalalignment | |
units = obj.units | |
obj | children |
endswitch endwhile set pm3d | implicit |
endif set | hidden3d |
endif | have_data = (! (isempty (data) || all (cellfun (@isempty, data)))) |
else | xdir = "noreverse" |
else | ydir = "noreverse" |
else | zdir = "noreverse" |
cmap_sz = rows(cmap) | |
endif else set | border |
else unset | ytics |
set y2tics s nomirror axis_obj | tickdir |
unset | xtics |
endif on | box = "box" |
else | reverse = "noreverse" |
endif | inout = "inside" |
keypos = axis_obj.keypos | |
keyout = findstr (keypos, "outside") | |
else | plot_cmd = "splot" |
rot_x = 90 - axis_obj.view(2) | |
rot_z = axis_obj.view(1) | |
set view | map |
float32 | |
endif unset | view |
found_style = false | |
case | __pad5__ |
endif linewidth | f = fnt |
endif linewidth obj | linewidth |
pt2 = "7" | |
set m stics | d |
ax = ca | |
num_mtics | |
axispos | |
ticklength | |
endif endif endfunction function | ticklabel |
endif endfunction | function [f, s, fnt, it, bld] |
else | fnt = t.fontname |
it = false | |
bld = false | |
endif | str = getfield (obj, fld) |
warned_latex = true | |
persistent | flds = fieldnames (sym) |
b2 = strfind(str(e(i) + 1:end),'}') | |
endif else for | j |
break | |
endif endfor endif endif | endfor [s, m] = regexp(str,'[_\^]','start','matches') |
p = 0 | |
si = 1 | |
l1 = strfind(str(s(i) + p + 1:end),'}') | |
li = 1 | |
l2 = strfind(str(s(i + 1) + p + 1:end),'}') | |
endif endwhile endfunction function | l |
endif endfunction function | sym |
sym | exists = '{/Symbol \044}' |
sym | ni = '{/Symbol \047}' |
sym | cong = '{/Symbol \100}' |
sym | Delta = '{/Symbol D}' |
sym | Phi = '{/Symbol F}' |
sym | Gamma = '{/Symbol G}' |
sym | vartheta = '{/Symbol J}' |
sym | Lambda = '{/Symbol L}' |
sym | Pi = '{/Symbol P}' |
sym | Theta = '{/Symbol Q}' |
sym | Sigma = '{/Symbol S}' |
sym | varsigma = '{/Symbol V}' |
sym | Omega = '{/Symbol W}' |
sym | Xi = '{/Symbol X}' |
sym | Psi = '{/Symbol Y}' |
sym | perp = '{/Symbol \136}' |
sym | alpha = '{/Symbol a}' |
sym | beta = '{/Symbol b}' |
sym | chi = '{/Symbol c}' |
sym | delta = '{/Symbol d}' |
sym | epsilon = '{/Symbol e}' |
sym | phi = '{/Symbol f}' |
sym | gamma = '{/Symbol g}' |
sym | eta = '{/Symbol h}' |
sym | iota = '{/Symbol i}' |
sym | varphi = '{/Symbol j}' |
sym | kappa = '{/Symbol k}' |
sym | lambda = '{/Symbol l}' |
sym | mu = '{/Symbol m}' |
sym | nu = '{/Symbol n}' |
sym | o = '{/Symbol o}' |
sym | pi = '{/Symbol p}' |
sym | theta = '{/Symbol q}' |
sym | rho = '{/Symbol r}' |
sym | sigma = '{/Symbol s}' |
sym | tau = '{/Symbol t}' |
sym | upsilon = '{/Symbol u}' |
sym | varpi = '{/Symbol v}' |
sym | omega = '{/Symbol w}' |
sym | xi = '{/Symbol x}' |
sym | psi = '{/Symbol y}' |
sym | zeta = '{/Symbol z}' |
sym | sim = '{/Symbol \176}' |
sym | Upsilon = '{/Symbol \241}' |
sym | prime = '{/Symbol \242}' |
sym | leq = '{/Symbol \243}' |
sym | infty = '{/Symbol \245}' |
sym | clubsuit = '{/Symbol \247}' |
sym | diamondsuit = '{/Symbol \250}' |
sym | heartsuit = '{/Symbol \251}' |
sym | spadesuit = '{/Symbol \252}' |
sym | leftrightarrow = '{/Symbol \253}' |
sym | leftarrow = '{/Symbol \254}' |
sym | uparrow = '{/Symbol \255}' |
sym | rightarrow = '{/Symbol \256}' |
sym | downarrow = '{/Symbol \257}' |
sym | circ = '{/Symbol \260}' |
sym | pm = '{/Symbol \261}' |
sym | geq = '{/Symbol \263}' |
sym | times = '{/Symbol \264}' |
sym | propto = '{/Symbol \265}' |
sym | partial = '{/Symbol \266}' |
sym | bullet = '{/Symbol \267}' |
sym | div = '{/Symbol \270}' |
sym | neq = '{/Symbol \271}' |
sym | equiv = '{/Symbol \272}' |
sym | approx = '{/Symbol \273}' |
sym | ldots = '{/Symbol \274}' |
sym | mid = '{/Symbol \275}' |
sym | aleph = '{/Symbol \300}' |
sym | Im = '{/Symbol \301}' |
sym | Re = '{/Symbol \302}' |
sym | wp = '{/Symbol \303}' |
sym | otimes = '{/Symbol \304}' |
sym | oplus = '{/Symbol \305}' |
sym | oslash = '{/Symbol \306}' |
sym | cap = '{/Symbol \307}' |
sym | cup = '{/Symbol \310}' |
sym | supset = '{/Symbol \311}' |
sym | supseteq = '{/Symbol \312}' |
sym | subset = '{/Symbol \314}' |
sym | subseteq = '{/Symbol \315}' |
sym | in = '{/Symbol \316}' |
sym | notin = '{/Symbol \317}' |
sym | bigtriangledown = '{/Symbol \321}' |
sym | langle = '{/Symbol \341}' |
sym | rangle = '{/Symbol \361}' |
sym | nabla = '{/Symbol \321}' |
sym | prod = '{/Symbol \325}' |
sym | surd = '{/Symbol \326}' |
sym | cdot = '{/Symbol \327}' |
sym | neg = '{/Symbol \330}' |
sym | wedge = '{/Symbol \331}' |
sym | vee = '{/Symbol \332}' |
sym | Leftrightarrow = '{/Symbol \333}' |
sym | Leftarrow = '{/Symbol \334}' |
sym | Uparrow = '{/Symbol \335}' |
sym | Rightarrow = '{/Symbol \336}' |
sym | Downarrow = '{/Symbol \337}' |
sym | diamond = '{/Symbol \340}' |
sym | copyright = '{/Symbol \343}' |
sym | lfloor = '{/Symbol \353}' |
sym | lceil = '{/Symbol \351}' |
sym | rfloor = '{/Symbol \373}' |
sym | rceil = '{/Symbol \371}' |
sym | int = '{/Symbol \362}' |
endfunction function | retval |
endif endif endfunction function | typ |
set y2label s s s __do_enhanced_option__ | ( | enhanced | , | |
t | ||||
) |
else __gnuplot_write_data__ | ( | plot_stream | ) |
function __go_draw_axes__ | ( | h | , | |
plot_stream | , | |||
enhanced | , | |||
mono | , | |||
implicit_margin | ||||
) |
endif do_tics | ( | axis_obj | , | |
plot_stream | , | |||
ymirror | , | |||
mono | , | |||
gnuplot_term | ||||
) |
elseif | ( | isequal(color,[1, 1, 0]) | ) |
elseif | ( | isequal(color,[1, 1, 1]) | ) |
elseif | ( | isequal(color,[0, 1, 1]) | ) |
elseif | ( | isequal(color,[1, 0, 1]) | ) |
elseif | ( | isequal(color,[0, 0, 1]) | ) |
elseif | ( | isequal(color,[0, 1, 0]) | ) |
elseif | ( | isequal(color,[1, 0, 0]) | ) |
endif elseif | ( | strcmpi(f,"fontsize") | ) |
endif elseif | ( | strcmpi(f,"fontname") | ) |
endif elseif | ( | strcmpi(f,"color") | ) |
endif elseif | ( | strncmp(f,"bf", 2) | ) |
elseif | ( | strncmp(f,"it", 2)||strncmp(f,"sl", 2) | ) |
elseif | ( | strncmp(f,"rm", 2) | ) |
elseif | ( | strcmpi(obj.interpreter,"latex") | ) |
endif elseif | ( | ! | isemptyt.fontangle)&&(strcmpi(t.fontangle,"italic")||strcmpi(t.fontangle,"oblique") | ) |
elseif | ( | is_image_data(i-1) | ) |
elseif | ( | is_image_data(i) | ) |
elseif | ( | is_image_data(1) | ) |
elseif | ( | ! | isemptyobj.children | ) |
endif elseif | ( | isnumeric(obj.edgecolor) | ) |
endif elseif | ( | strncmp(obj.edgecolor,"interp", 6) | ) |
elseif | ( | __gnuplot_has_feature__("transparent_patches")&&isscalar(obj.facealpha) | ) |
endif endif elseif | ( | isnumeric(obj.facecolor) | ) |
endif elseif | ( | strncmp(obj.facecolor,"interp", 6) | ) |
elseif | ( | nd | = =3 &&numel(xcol)==3 |
) |
elseif | ( | ndims(obj.cdata) | = =2 &&(size(obj.cdata, 1)==nc &&(size(obj.cdata, 2)==1||size(obj.cdata, 2)==3)) |
) | = permute (cdat (:, i, :), [1, 3, 2]) |
endif elseif | ( | xerr | ) |
elseif | ( | strcmpi(obj.cdatamapping,"direct") | ) |
endif otherwise error | ( | "__go_draw_axes__: unknown object | class, | |
%s" | , | |||
obj. | type | |||
) |
endif fflush | ( | plot_stream | ) |
else fprintf | ( | plot_stream | , | |
"set %stics %s %s %s nomirror %s %s;\n" | , | |||
ax | , | |||
tickdir | , | |||
ticklength | , | |||
axispos | , | |||
colorspec | , | |||
fontspec | ||||
) |
else fprintf | ( | plot_stream | , | |
"unset m%stics;\n" | , | |||
ax | ||||
) |
fprintf | ( | plot_stream | , | |
"%.15g %.15g %.15g %.15g\n\n" | ||||
) |
fprintf | ( | plot_stream | , | |
"%.15g %.15g %.15g %.15g\n" | ||||
) |
else fprintf | ( | plot_stream | ) |
endif fprintf | ( | plot_stream | , | |
"set key %s %s %s %s %s;\n" | , | |||
inout | , | |||
pos | , | |||
box | , | |||
reverse | , | |||
fontspec | ||||
) |
endif endfor fprintf | ( | plot_stream | , | |
"set cbrange ;\n" | [%g:%g], | |||
clim(1) | , | |||
clim(2)*(cmap_sz+rows(addedcmap))/ | cmap_sz | |||
) |
else fprintf | ( | plot_stream | , | |
"set label \"%s\" at %s %. | 15g, | |||
%.15g%s rotate by%f%s%s front%s;\n" | , | |||
undo_string_escapes(label) | , | |||
units | , | |||
lpos(1) | , | |||
lpos(2) | , | |||
halign | , | |||
angle | , | |||
fontspec | , | |||
__do_enhanced_option__(enhanced, obj) | , | |||
colorspec | ||||
) |
endif fprintf | ( | plot_stream | , | |
"set mztics %d;\n" | , | |||
m | ||||
) |
fprintf | ( | plot_stream | , | |
"set grid m%stics;\n" | , | |||
yaxisloc | ||||
) |
fprintf | ( | plot_stream | , | |
"set grid m%stics;\n" | , | |||
xaxisloc | ||||
) |
fprintf | ( | plot_stream | , | |
"set grid %stics;\n" | , | |||
yaxisloc | ||||
) |
fprintf | ( | plot_stream | , | |
"set grid %stics;\n" | , | |||
xaxisloc | ||||
) |
fprintf | ( | plot_stream | , | |
"set zlabel \"%s\" %s %s %s" | , | |||
undo_string_escapes(tt) | , | |||
colorspec | , | |||
fontspec | , | |||
__do_enhanced_option__(enhanced, t) | ||||
) |
else fprintf | ( | plot_stream | , | |
"set ylabel \"%s\" %s %s %s" | , | |||
undo_string_escapes(tt) | , | |||
colorspec | , | |||
fontspec | , | |||
__do_enhanced_option__(enhanced, t) | ||||
) |
else fprintf | ( | plot_stream | , | |
"unset y2label;\n" | ||||
) |
fprintf | ( | plot_stream | , | |
" rotate by %f;\n" | , | |||
angle | ||||
) |
else fprintf | ( | plot_stream | , | |
"set xlabel \"%s\" %s %s %s" | , | |||
undo_string_escapes(tt) | , | |||
colorspec | , | |||
fontspec | , | |||
__do_enhanced_option__(enhanced, t) | ||||
) |
else fprintf | ( | plot_stream | , | |
"unset x2label;\n" | ||||
) |
else fprintf | ( | plot_stream | , | |
";\n" | ||||
) |
fprintf | ( | plot_stream | , | |
"set title \"%s\" %s %s" | , | |||
undo_string_escapes(tt) | , | |||
fontspec | , | |||
__do_enhanced_option__(enhanced, t) | ||||
) |
fprintf | ( | plot_stream | , | |
"set size ratio %.15g;\n" | , | |||
- | r2)/r(1 | |||
) |
fprintf | ( | plot_stream | , | |
"set size %. | 15g, | |||
%.15g;\n" | , | |||
pos(3) | , | |||
pos(4) | ||||
) |
fprintf | ( | plot_stream | , | |
"set origin %. | 15g, | |||
%.15g;\n" | , | |||
pos(1) | , | |||
pos(2) | ||||
) |
fprintf | ( | plot_stream | , | |
"set rmargin 0;\n" | ||||
) |
fprintf | ( | plot_stream | , | |
"set lmargin 0;\n" | ||||
) |
fprintf | ( | plot_stream | , | |
"set bmargin 0;\n" | ||||
) |
else fprintf | ( | plot_stream | , | |
"set tmargin 0;\n" | ||||
) |
fprintf | ( | plot_stream | , | |
"set rmargin screen %.15g;\n" | , | |||
pos(1)+pos(3)/2+x(1)*pos(3)/ | 2 | |||
) |
fprintf | ( | plot_stream | , | |
"set lmargin screen %.15g;\n" | , | |||
pos(1)+pos(3)/2-x(1)*pos(3)/ | 2 | |||
) |
fprintf | ( | plot_stream | , | |
"set bmargin screen %.15g;\n" | , | |||
pos(2)+pos(4)/2-x(2)*pos(4)/ | 2 | |||
) |
endfor fputs | ( | plot_stream | , | |
"e\n" | ||||
) |
endwhile fputs | ( | plot_stream | , | |
"set ticslevel 0;\n" | ||||
) |
endif fputs | ( | plot_stream | , | |
"unset colorbox;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set border 3;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set border 6;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set border 9;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set border 12;\n" | ||||
) |
else fputs | ( | plot_stream | , | |
"set pm3d explicit;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"unset contour;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set surface;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set clip two;\n" | ||||
) |
else fputs | ( | plot_stream | , | |
"unset logscale z;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set border back;\n" | ||||
) |
else fputs | ( | plot_stream | , | |
"set grid layerdefault;\n" | ||||
) |
else fputs | ( | plot_stream | , | |
"set grid nomztics;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set grid mztics;\n" | ||||
) |
else fputs | ( | plot_stream | , | |
"set grid noztics;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"set grid ztics;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"unset x2tics;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"unset ztics;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"unset ytics;\n" | ||||
) |
fputs | ( | plot_stream | , | |
"unset xtics;\n" | ||||
) |
else fputs | ( | plot_stream | , | |
"set size noratio;\n" | ||||
) |
fwrite | ( | plot_stream | , | |
"\n" | ||||
) |
fwrite | ( | plot_stream | , | |
"float32" | ||||
) |
have_3d_patch | ( | data_idx | ) |
have_cdata | ( | data_idx | ) |
if | ( | ! | isemptym | ) |
if | ( | s(i)+l1+ | 1 = =s(i+1) |
) |
if | ( | isempty(b1)||isempty(b2) | ) |
if | ( | isempty(d) | ) |
if | ( | it | ) |
if | ( | bld | ) |
if | ( | isfield(sym, f) | ) |
if | ( | enhanced | ) |
if | ( | strcmp(fld,"string") | ) |
endif if | ( | isempty(t.fontsize) | ) |
if | ( | ! | isemptyt.fontweight)&&strcmpi(t.fontweight,"bold" | ) |
if | ( | mirror | ) |
if | ( | strcmp(mtics,"on") | ) |
endif if | ( | ! | isemptyerrbars | ) |
if | ( | isnumeric(linecolor) | ) |
if | ( | have_data | ) |
if | ( | length(cmap) | , | |
0 | ||||
) |
endswitch if | ( | __gnuplot_has_feature__("key_has_font_properties") | ) |
if | ( | ! | isemptykeyout | ) |
if | ( | ischar(keypos) | ) |
endif if | ( | strcmpi(axis_obj.keyreverse,"on") | ) |
endif if | ( | strcmpi(axis_obj.key,"on") | ) |
endif endif endif endif if | ( | strcmpi(axis_obj.visible,"off") | ) |
if | ( | ! | anyisinf(clim) | ) |
endif if | ( | strcmpi(axis_obj.zdir,"reverse") | ) |
endif if | ( | strcmpi(axis_obj.ydir,"reverse") | ) |
endif if | ( | strcmpi(axis_obj.xdir,"reverse") | ) |
if | ( | isempty(xlim) | ) |
endif if | ( | isnan(hidden_removal)|| | hidden_removal | ) |
if | ( | strcmpi(units,"normalized") | ) |
endif if | ( | withpm3d && | strncmpstyle{1},"linespoints", 11 | ) |
endif if | ( | strncmp(obj.edgecolor,"flat", 4) | ) |
if | ( | isfield(obj,"markersize") | ) |
if | ( | ! | isvectorccdat | ) |
endif if | ( | strncmp(obj.facecolor,"flat", 4) | ) |
endif cdata if | ( | ndims(obj.cdata) | = =2 &&(size(obj.cdata, 2)==nc &&(size(obj.cdata, 1)==1||size(obj.cdata, 1)==3)) |
) |
endif if | ( | i | , | |
1|| | isemptyobj.keylabel | |||
) |
else if | ( | isnan(data_3d_idx) | ) |
else if | ( | isnan(hidden_removal) | ) |
if | ( | strcmpi(obj.cdatamapping,"direct") | ) |
if | ( | ! | isemptyobj.cdata | ) |
if | ( | length(style) | , | |
1 | ||||
) |
endif if | ( | xerr | ) |
if | ( | ! | isemptyxudat | ) |
if | ( | ! | isemptyxldat | ) |
if | ( | ! | isemptyudat | ) |
if | ( | ! | isemptyldat | ) |
if | ( | ! | isemptyobj.zdata | ) |
if | ( | isempty(obj.keylabel) | ) |
endif case line if | ( | strncmp(obj.linestyle,"none", 4)&&(!isfield(obj,"marker")||(isfield(obj,"marker")&&strncmp(obj.marker,"none", 4))) | ) |
if | ( | x_dim | , | |
1 | ||||
) |
if | ( | use_gnuplot_for_images | ) |
if | ( | strcmpi(obj.visible,"off") | ) |
if | ( | !cautoscale && | clim1 = =clim(2) |
) |
if | ( | zlogscale | ) |
if | ( | ylogscale | ) |
if | ( | xlogscale | ) |
endif if | ( | ! | have_grid | ) |
endif if | ( | strcmpi(axis_obj.layer,"top") | ) |
if | ( | strcmp(axis_obj.zscale,"log") | ) |
endif if | ( | strcmpi(axis_obj.zminorgrid,"on") | ) |
if | ( | strcmp(axis_obj.yscale,"log") | ) |
endif if | ( | strcmpi(axis_obj.yminorgrid,"on") | ) |
if | ( | strcmp(axis_obj.xscale,"log") | ) |
endif if | ( | strcmpi(axis_obj.xminorgrid,"on") | ) |
endif if | ( | strcmpi(axis_obj.zgrid,"on") | ) |
endif if | ( | strcmpi(axis_obj.ygrid,"on") | ) |
if | ( | strcmpi(axis_obj.xgrid,"on") | ) |
if | ( | strcmpi(axis_obj.yaxislocation,"zero") | ) |
if | ( | strcmpi(axis_obj.xaxislocation,"zero") | ) |
if | ( | strcmpi(axis_obj.yaxislocation,"right") | ) |
if | ( | strcmpi(axis_obj.xaxislocation,"top") | ) |
if | ( | isempty(t.string) | ) |
if | ( | ! | isemptyaxis_obj.title | ) |
if | ( | strcmpi(axis_obj.dataaspectratiomode,"manual") | ) |
if | ( | __gnuplot_has_feature__("screen_coordinates_for_{lrtb}margin") | ) |
if | ( | strcmp(axis_obj.tag,"plotyy") | ) |
is_image_data | ( | data_idx | ) |
lpos | ( | 3 | ) |
lpos | ( | 2 | ) |
lpos | ( | 1 | ) |
id lt | ( | ) | [virtual] |
set stics s s s mirror | ( | " | , | |
ax | , | |||
tickdir | , | |||
ticklength | , | |||
axispos | ||||
) |
parametric | ( | data_idx | ) |
pos | ( | 4 | ) |
else print_usage | ( | ) |
reshape | ( | color | , | |
1 | , | |||
3 | ||||
) |
linecolor rgb round | ( | 255 * | color | ) |
unwind_protect_cleanup set | ( | 0 | , | |
"showhiddenhandles" | , | |||
showhiddenhandles | ||||
) |
italic strcmpi | ( | t. | fontangle, | |
"oblique" | ||||
) |
endif strncmp | ( | obj. | facecolor, | |
"interp" | , | |||
6 | ||||
) |
switch | ( | obj. | type | ) |
undo_string_escapes | ( | label | ) |
set x2label s s s undo_string_escapes | ( | tt | ) |
id usingclause | ( | ) | [virtual] |
while | ( | li<= | lengthl2)&&si<=length(s2 | ) |
while | ( | li<= | lengthl1)&&si<=length(s1 | ) |
while | ( | ) |
while | ( | ! | isemptykids | ) |
zz | ( | : | , | |
kk+ | 1 | |||
) |
case __pad4__ |
case __pad5__ |
addedcmap = [] |
ax = ca |
axis_obj = __get__ (h) |
sym bigtriangledown = '{/Symbol \321}' |
bld = false |
else box = "box" |
break |
cautoscale = strcmpi (axis_obj.climmode, "auto") |
cdatadirect = false |
endif set m stics d |
data = cell () |
data_3d_idx = NaN |
sym diamondsuit = '{/Symbol \250}' |
errbars = "" |
fnt = t.fontname |
else fontspec = create_fontspec (f, s, gnuplot_term) |
found_style = false |
endif endfunction function[str, f, s] |
gnuplot_term = __gnuplot_get_var__ (axis_obj.parent, "GPVAL_TERM") |
grid |
halign = obj.horizontalalignment |
endif endif hidden_removal = NaN |
imagetype = "rgbimage" |
inout = "inside" |
is_image_data = [] |
it = false |
case<"pt="10";pt2="11";case{"pentagram","p"}pt=pt2="3";case{"hexagram","h"}pt=pt2="3";case"none"pt=pt2="";otherwisept=pt2="";endswitchelsept=pt2="";endifif(!isempty(pt))found_style=true;endifsidx=1;if(isempty(errbars))if(isempty(lt))style{sidx}="";elsestyle{sidx}="lines";endiffacesame=true;if(!isequal(pt,pt2)&&isfield(obj,"markerfacecolor")&&!strncmp(obj.markerfacecolor,"none",4))if(strncmp(obj.markerfacecolor,"auto",4)||!isnumeric(obj.markerfacecolor)||(isnumeric(obj.markerfacecolor)&&isequal(color,obj.markerfacecolor)))style{sidx}=strcat(style{sidx},"points");if(!isempty(pt2))fprintf(plot_stream,"pointtype%s",pt2);endifif(isfield(obj,"markersize"))fprintf(plot_stream,"pointsize%f",obj.markersize/3);endifelsefacesame=false;if(!found_style)fputs(plot_stream,"default");endiffputs(plot_stream,";\n");if(!isempty(style{sidx}))sidx++;idx++;elsefputs(plot_stream,";\n");endiffprintf(plot_stream,"setstyleline%ddefault;\n",idx);fprintf(plot_stream,"setstyleline%d",idx);if(isnumeric(obj.markerfacecolor)&&!mono)fprintf(plot_stream,"linecolorrgb\"#%02x%02x%02x\"",round(255*obj.markerfacecolor));endifstyle{sidx}="points";if(!isempty(pt2))fprintf(plot_stream,"pointtype%s",pt2);endifif(isfield(obj,"markersize"))fprintf(plot_stream,"pointsize%f",obj.markersize/3);endifendifendifif(isfield(obj,"markeredgecolor")&&!strncmp(obj.markeredgecolor,"none",4))if(facesame&&(strncmp(obj.markeredgecolor,"auto",4)||!isnumeric(obj.markeredgecolor)||(isnumeric(obj.markeredgecolor)&&isequal(color,obj.markeredgecolor))))if(!isequal(pt,pt2)&&sidx==1&&((length(style{sidx})==5&&strncmp(style{sidx},"lines",5))||isempty(style{sidx})))style{sidx}=strcat(style{sidx},"points");if(!isempty(pt))fprintf(plot_stream,"pointtype%s",pt);endifif(isfield(obj,"markersize"))fprintf(plot_stream,"pointsize%f",obj.markersize/3);endifendifelseif(!found_style)fputs(plot_stream,"default");endiffputs(plot_stream,";\n");if(!isempty(style{sidx}))sidx++;idx++;elsefputs(plot_stream,";\n");endiffprintf(plot_stream,"setstyleline%ddefault;\n",idx);fprintf(plot_stream,"setstyleline%d",idx);if(!mono)if(strncmp(obj.markeredgecolor,"auto",4))fprintf(plot_stream,"linecolorrgb\"#%02x%02x%02x\"",round(255*color));elseif(isnumeric(obj.markeredgecolor)&&!mono)fprintf(plot_stream,"linecolorrgb\"#%02x%02x%02x\"",round(255*obj.markeredgecolor));endifendifstyle{sidx}="points";if(!isempty(pt))fprintf(plot_stream,"pointtype%s",pt);endifif(isfield(obj,"markersize"))fprintf(plot_stream,"pointsize%f",obj.markersize/3);endifendifendifelsestyle{1}=errbars;endifif(!found_style&&isempty(style{1}))fputs(plot_stream,"default");endiffputs(plot_stream,";\n");endfunctionfunctionnd=__calc_dimensions__(obj)kids=obj.children;nd=2;fori=1:length(kids)obj=get(kids(i));switch(obj.type)case{"image","text"}case{"line","patch"}if(!isempty(obj.zdata))nd=3;endifcase"surface"nd=3;case"hggroup"obj_nd=__calc_dimensions__(obj);if(obj_nd==3)nd=3;endifendswitchendforendfunctionfunction__gnuplot_write_data__(plot_stream,data,nd,parametric,cdata)idx=find(isna(data));if(any(idx))data(idx)=NaN;endifif(nd==2)fwrite(plot_stream,data,"float64");elseif(nd==3)if(parametric)fwrite(plot_stream,data,"float64");elsenr=rows(data);if(cdata)forj=1:4:nrfwrite(plot_stream,data(j:j+3,:),"float64");endforelseforj=1:3:nrfwrite(plot_stream,data(j:j+2,:),"float64");endforendifendifendifendfunctionfunctiondo_tics(obj,plot_stream,ymirror,mono,gnuplot_term)obj.xticklabel=ticklabel_to_cell(obj.xticklabel);obj.yticklabel=ticklabel_to_cell(obj.yticklabel);obj.zticklabel=ticklabel_to_cell(obj.zticklabel);if(strcmp(obj.xminorgrid,"on"))obj.xminortick="on";endifif(strcmp(obj.yminorgrid,"on"))obj.yminortick="on";endifif(strcmp(obj.zminorgrid,"on"))obj.zminortick="on";endif k[fontname,fontsize]=get_fontname_and_size(obj);fontspec=create_fontspec(fontname,fontsize,gnuplot_term);ticklength=sprintf("scale%4.1f",(69/0.5)*obj.ticklength(1));if(strcmpi(obj.xaxislocation,"top"))do_tics_1(obj.xtickmode,obj.xtick,obj.xminortick,obj.xticklabelmode,obj.xticklabel,obj.xcolor,"x2",plot_stream,true,mono,"border",obj.tickdir,ticklength,fontname,fontspec,obj.interpreter,obj.xscale);do_tics_1("manual",[],"off",obj.xticklabelmode,obj.xticklabel,obj.xcolor,"x",plot_stream,true,mono,"border","","",fontname,fontspec,obj.interpreter,obj.xscale);elseif(strcmpi(obj.xaxislocation,"zero"))do_tics_1(obj.xtickmode,obj.xtick,obj.xminortick,obj.xticklabelmode,obj.xticklabel,obj.xcolor,"x",plot_stream,true,mono,"axis",obj.tickdir,ticklength,fontname,fontspec,obj.interpreter,obj.xscale);do_tics_1("manual",[],"off",obj.xticklabelmode,obj.xticklabel,obj.xcolor,"x2",plot_stream,true,mono,"axis","","",fontname,fontspec,obj.interpreter,obj.xscale);elsedo_tics_1(obj.xtickmode,obj.xtick,obj.xminortick,obj.xticklabelmode,obj.xticklabel,obj.xcolor,"x",plot_stream,true,mono,"border",obj.tickdir,ticklength,fontname,fontspec,obj.interpreter,obj.xscale);do_tics_1("manual",[],"off",obj.xticklabelmode,obj.xticklabel,obj.xcolor,"x2",plot_stream,true,mono,"border","","",fontname,fontspec,obj.interpreter,obj.xscale);endifif(strcmpi(obj.yaxislocation,"right"))do_tics_1(obj.ytickmode,obj.ytick,obj.yminortick,obj.yticklabelmode,obj.yticklabel,obj.ycolor,"y2",plot_stream,ymirror,mono,"border",obj.tickdir,ticklength,fontname,fontspec,obj.interpreter,obj.yscale);do_tics_1("manual",[],"off",obj.yticklabelmode,obj.yticklabel,obj.ycolor,"y",plot_stream,ymirror,mono,"border","","",fontname,fontspec,obj.interpreter,obj.yscale);elseif(strcmpi(obj.yaxislocation,"zero"))do_tics_1(obj.ytickmode,obj.ytick,obj.yminortick,obj.yticklabelmode,obj.yticklabel,obj.ycolor,"y",plot_stream,ymirror,mono,"axis",obj.tickdir,ticklength,fontname,fontspec,obj.interpreter,obj.yscale);do_tics_1("manual",[],"off",obj.yticklabelmode,obj.yticklabel,obj.ycolor,"y2",plot_stream,ymirror,mono,"axis","","",fontname,fontspec,obj.interpreter,obj.yscale);elsedo_tics_1(obj.ytickmode,obj.ytick,obj.yminortick,obj.yticklabelmode,obj.yticklabel,obj.ycolor,"y",plot_stream,ymirror,mono,"border",obj.tickdir,ticklength,fontname,fontspec,obj.interpreter,obj.yscale);do_tics_1("manual",[],"off",obj.yticklabelmode,obj.yticklabel,obj.ycolor,"y2",plot_stream,ymirror,mono,"border","","",fontname,fontspec,obj.interpreter,obj.yscale);endifdo_tics_1(obj.ztickmode,obj.ztick,obj.zminortick,obj.zticklabelmode,obj.zticklabel,obj.zcolor,"z",plot_stream,true,mono,"border",obj.tickdir,ticklength,fontname,fontspec,obj.interpreter,obj.yscale);endfunctionfunctiondo_tics_1(ticmode,tics,mtics,labelmode,labels,color,ax,plot_stream,mirror,mono,axispos,tickdir,ticklength,fontname,fontspec,interpreter,scale)persistentwarned_latex=false;if(strcmpi(interpreter,"tex"))forn=1:numel(labels)labels{n}=__tex2enhanced__(labels{n},fontname,false,false);endforelseif(strcmpi(interpreter,"latex"))if(!warned_latex)warning("latexmarkupnotsupportedfortickmarks");warned_latex=true;endifendifif(strcmp(scale,"log"))fmt="10^{%T}";num_mtics=10;elsefmt="%g";num_mtics=5;endifcolorspec=get_text_colorspec(color,mono);if(strcmpi(ticmode,"manual")||strcmpi(labelmode,"manual"))if(isempty(tics))fprintf(plot_stream,"unset%stics;\nunsetm%stics;\n",ax,ax);elseif(strcmpi(labelmode,"manual"))if(ischar(labels))labels=cellstr(labels);endifif(isnumeric(labels))labels=num2str(real(labels(:)));endifif(ischar(labels))labels=permute(cellstr(labels),[2,1]);endifif(iscellstr(labels))k=1;ntics=numel(tics);nlabels=numel(labels);fprintf(plot_stream,"setformat%s\"%%s\";\n",ax);if(mirror)fprintf(plot_stream,"set%stics%s%s%smirror(",ax,tickdir,ticklength,axispos);elsefprintf(plot_stream,"set%stics%s%s%snomirror(",ax,tickdir,ticklength,axispos);endiflabels=regexprep(labels,"%","%%");fori=1:nticsfprintf(plot_stream,"\"%s\"%.15g",labels{k++},tics(i));if(i<ntics)fputs(plot_stream,",");endifif(k> nlabels = 1 |
ldat = obj.ldata |
sym Leftrightarrow = '{/Symbol \333}' |
sym leftrightarrow = '{/Symbol \253}' |
li = 1 |
lpos = obj.position |
m = 5 |
set view map |
n |
sym ni = '{/Symbol \047}' |
p = 0 |
set parametric |
otherwise pos = axis_obj.position |
case pt = "pt 6" |
pt2 = "7" |
else retval |
Initial value:
__do_enhanced_option__ (enhanced, obj) retval = ""
sym Rightarrow = '{/Symbol \336}' |
sym rightarrow = '{/Symbol \256}' |
rot_x = 90 - axis_obj.view(2) |
rot_z = axis_obj.view(1) |
s = t.fontsize |
set | ( | 0 | , | |
"showhiddenhandles" | , | |||
"on" | ||||
) |
si = 1 |
Initial value:
__setup_sym_table__ () sym.forall = '{/Symbol \042}'
title |
truecolor = false |
endif unset view |
view_map = false |
warned_latex = true |
else x = 1.0 ./ sqrt([2, 2.5]) |
endif xautoscale = strcmpi (axis_obj.xlimmode, "auto") |
xaxisloc = "x" |
xaxisloc_using = "x2" |
ximg_data = {} |
ximg_data_idx = 0 |
xlabel |
contour(x xlim = axis_obj.xlim |
xlogscale = strcmpi (axis_obj.xscale, "log") |
unset xtics |
set xzeroaxis |
yautoscale = strcmpi (axis_obj.ylimmode, "auto") |
yaxisloc = "y" |
yaxisloc_using = "y2" |
yerr = xerr = false |
ylabel |
set yzeroaxis |
set logscale z |
zautoscale = strcmpi (axis_obj.zlimmode, "auto") |
unset zlabel |