\\ v is a vector of pairs = [[x1,y1],[x2,y2],...]. t_writedots (file,v,dig=2,rowlen=10) = {my (n,w); n=#v; w=vector(n,i,Strprintf("(%.*f,%.*f)",dig,v[i][1],dig,v[i][2])); T=t_table(w,rowlen); t_write(file,T)} \\ Writes pairs of args and vals to a file, \\ e.g. for plotting with pst-plot. If args is \\ a number, args start with this number; \\ otherwise args has to be a vector. t_writeplotpairs (file,vals,args=0,rowlen=20) = {my (n,w,T); n=#vals; if (type(args)=="t_VEC",\ w=vector(2*n,i, if (i%2, args[i\2+1], vals[i\2])), w=vector(2*n,i, if(i%2, i\2+args, vals[i\2]))); T=t_table(w,rowlen); t_write(file,T)} t_writewalk (file, v, neg=1) = {my (n=#v,w); if (neg, v=apply(x->if(x==0,-1,x),v)); w=vector(n,i,0); s=0; for (i=1,n,s+=v[i]; w[i]=s); t_writeplotpairs(file,w)}