{VERSION 4 0 "IBM INTEL LINUX" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2111 " psfilter := proc( p)\n\n # Sample Usage: psfilter(plot(x^2,x=-2..2), \n # \+ file=`myfile.eps`, height=3, width=4, noborder, landscape); #\n\n \+ \011local t1,t2,t3,ht,wd,fl,optionstring,opts,plotstruct,x,bd,lp;\n\n \+ \011#\n \011# Save current plotting information\n \011#\n \011t1 := in terface(plotdevice);\n \011t2 := interface(plotoutput);\n \011t3 := in terface(plotoptions);\n\n \011#\n \011# Grab the plot structure from t he argument\n \011#\n \011plotstruct := args[1..1];\n \011\n \011#\n \+ \011# Form a list of the remaining options given in p\n \011#\n \011op ts := [args[2..nargs]];\n \011\n \011#\n \011# Establish defaults\n \+ \011#\n \011lp := `portrait`;\n \011bd := `border`; \n \011ht := `h eight` || `=` || (convert(72*3, string)); # 3 inches high\n \011wd : = `width` || `=` || (convert(72*4, string)); # 4 inches wide\n \011 fl := `plot.ps`;\n \011\n \011#\n \011# Strip and process each option. ..\n \011#\n\n \011for x in opts do \011 \n \011 if type(x, identic al('height') = numeric) then\n \011 \011ht := `height` || `=` | | (convert(72*rhs(x), string));\n \011 # ( ... ) forces evaluation here\n \011 elif type(x, identical('width' ) = numeric) then\n \011 \011wd := `width` || `=` || (convert(7 2*rhs(x), string)); \011\n \011 elif type(x, identical('file') = symb ol) then\n fl := rhs(x);\n elif type(x, identical('border ')) then\n bd := `border`;\n \011 elif type(x, identical('p lotoutput') = symbol) then\n fl := rhs(x);\n elif type(x, identical('landscape')) then\n \011\011\011\011lp := `landscape `;\n \011 elif type(x, identical('portrait')) then\n \011\011\011\011 lp := `portrait`;\n elif type(x, identical('noborder')) then \n \011\011\011\011bd := `noborder`;\n else\n ERROR (`invalid option`, x);\n fi;\n \011od; \n\n #\n # Build the o ption string, preparing to call plotsetup\n #\n\n \011optionstring := `` || lp || `,` || bd || `,` || wd || `,` || ht;\n # Begins with a n ull string since the first operand is never\n # evaluated.\n\n \011pl otsetup(ps,plotoutput=fl,\n \011\011 plotoptions=optionstring) ;\n\n \011print(plotstruct); # force the plot to be output\n \011 \n # \n \011# Restore the original plotting characteristics\n \011#\n \n \011plotsetup(t1,plotoutput=t2,plotoptions=t3);\n \011end;\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "save \"psfilter.m\";" }}}} {MARK "2" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }