Tim Evans Maple Tips Page

Tim Evans Informal Home Page | Tim Evans Imperial College page

Finding and Setting the Current Directory

To check current directory or to change current directory. Note that to get a backslash on a PC you need to use a double backslash in a string. Also note the response of the first command seems to be the old location, the second command just prints out the current directory to confirm one has the right location.
currentdir("c:\\prg\\delta\\z2");
currentdir();

Output a plot to a postscript file

 datanameroot:=cat("Plot for N=",convert(N,string));
 psoutname:=cat(datanameroot,".eps");
 printf("Plot output to %A\n",psoutname);
 plotsetup(cps, plotoutput=psoutname,
   plotoptions=`portrait,noborder, height=300,width=300, leftmargin=0, bottommargin=0 `);
 display(plot1,plot2,plot3);
 plotsetup(default);
Note that this file appears to produce an error in Ghostview something about pages. It will still display. One solution is to edit the eps file in a text editor and to remove the line
%%Pages:  1
which is usually the fourth line of the eps file.

Plots of different colours

To get plots with a systematic change in colours for each data set or line, use
color=colourlist[iii]
to select iii-th colour from a list such as
colourlist:=[black,blue,green,red,brown,gold,maroon,orange,gray,
 magenta,pink,plum,cyan,grey,navy,khaki,sienna,tan,turquoise,
 violet,coral,aquamarine,wheat,white,yellow];