Functions | |
function | plotimages (nm, typ) set_print_size() |
hide_output () = figure (1) | |
if (strcmp(typ,"png")) set(0 | |
*endif | if (strcmp(typ,"txt")) image_as_txt(nm) |
elseif (strcmp(nm,"plot")) x | |
plot (x, sin(x)) | |
print (cstrcat(nm,".", typ), cstrcat("-d", typ)) elseif(strcmp(nm | |
hist | rand ("state", 2) |
hist (randn(10000, 1), 30) | |
errorbar (x, sin(x), yl, yu) | |
axis ([0, 10,-1.1, 1.1]) | |
polar | polar (0:0.1:10 *pi, 0:0.1:10 *pi) |
mesh (tx, ty, tz) | |
plot3 (r.*sin(t), r.*cos(t), z) | |
plot (x, erf(x)) | |
plot (x, x,"r") | |
text (0.65, 0.6175, cstrcat('\leftarrow x={2/\surd\pi{\fontsize{16}', '\int_{\fontsize{8}0}^{\fontsize{8}x}}e^{-t^2}dt}=0.6175')) print(cstrcat(nm | |
cstrcat ("-d", typ)) else error("unrecognized plot requested") | |
endfunction function | set_print_size () image_size |
set (0,"defaultfigurepapertype","<custom>") | |
set (0,"defaultfigurepapersize", image_size+2 *border) | |
set (0,"defaultfigurepaperposition",[border, border, image_size]) | |
set (f,"visible","off") | |
endfunction function | image_as_txt (nm) fid |
fputs (fid,"\n") | |
fputs (fid,"+---------------------------------+\n") | |
fputs (fid,"| Image unavailable in text mode. |\n") | |
fclose (fid) | |
Variables | |
defaulttextfontname | |
x = 0:0.1:10 | |
y = sin (x) | |
yl = 0.1 .* rand (size (x)) | |
yu = 0.1 .* rand (size (x)) | |
mesh | tx = ty = linspace (-8, 8, 41)' |
r = meshgrid (tx, ty) sqrt (xx .^ 2 + yy .^ 2) + eps | |
tz = sin (r) ./ r | |
plot3 | t = 0:0.1:10*pi |
z = linspace (0, 1, numel (t)) | |
hold | on |
typ | |
border = 0 |
axis | ( | ) |
cstrcat | ( | "-d" | , | |
typ | ||||
) |
elseif | ( | strcmp(nm,"plot") | ) |
fclose | ( | fid | ) |
fputs | ( | fid | , | |
"+---------------------------------+\n" | ||||
) |
fputs | ( | fid | , | |
"\n" | ||||
) |
endfunction function hide_output | ( | ) | = figure (1) |
hist | ( | randn(10000, 1) | , | |
30 | ||||
) |
if | ( | strcmp(typ,"png") | ) |
endfunction function image_as_txt | ( | nm | ) |
plot | ( | x | , | |
x | , | |||
"r" | ||||
) |
plot | ( | x | , | |
erf(x) | ||||
) |
plot | ( | x | , | |
sin(x) | ||||
) |
plot3 | ( | r.* | sint, | |
r.* | cost, | |||
z | ||||
) |
polar polar | ( | 0:0.1:10 * | pi, | |
0:0.1:10 * | pi | |||
) |
( | cstrcat(nm,".", typ) | , | ||
cstrcat("-d", typ) | ||||
) |
hist rand | ( | "state" | , | |
2 | ||||
) |
set | ( | f | , | |
"visible" | , | |||
"off" | ||||
) |
set | ( | 0 | , | |
"defaultfigurepaperposition" | ||||
) |
set | ( | 0 | , | |
"defaultfigurepapersize" | , | |||
image_size+2 * | border | |||
) |
set | ( | 0 | , | |
"defaultfigurepapertype" | , | |||
"<custom>" | ||||
) |
endfunction function set_print_size | ( | ) |
text | ( | 0. | 65, | |
0. | 6175, | |||
cstrcat('\leftarrow x={2/\surd\pi{\fontsize{16}', '\int_{\fontsize{8}0}^{\fontsize{8}x}}e^{-t^2}dt}=0.6175') | ||||
) |
hold on |
plot3 t = 0:0.1:10*pi |
tz = sin (r) ./ r |
extended x = 0:0.1:10 |
y = sin (x) |
yl = 0.1 .* rand (size (x)) |
yu = 0.1 .* rand (size (x)) |
z = linspace (0, 1, numel (t)) |