}
void graphFile(picture pic=currentpicture, string file="datafile",
+ int xcol=0, int ycol=1,
real xscale=1, real yscale=1, pen p=red,
path mpath=scale(0.8mm)*unitcircle,
markroutine markroutine=marknodes,
file fin=input(file).line();
real[][] a=fin.dimension(0,0);
a=transpose(a);
- real[] x=a[0];
- real[] y=a[1];
+ real[] x=a[xcol];
+ real[] y=a[ycol];
if (dots == true) {
pline = invisible;
mk = marker(mpath, markroutine, p);
}
void graphMatrixFile(picture pic=currentpicture, string file="datafile",
+ int xcol=0, int ycol=1, int zcol=2,
real xscale=1, real yscale=1,
real[] zfn(real[] z)=identity_zfn,
pen[] p=BWRainbow(), Label x_label=null,
if (a[i].length < 3)
a.delete(i);
a = transpose(a);
- real[] xs = a[0];
- real[] ys = a[1];
- real[] zs = zfn(a[2]);
+ real[] xs = a[xcol];
+ real[] ys = a[ycol];
+ real[] zs = zfn(a[zcol]);
real[][] z = extract_matrix(xs, ys, zs);
pair initial = (xscale*min(xs), yscale*min(ys));
pair final = (xscale*max(xs), yscale*max(ys));