# Copyright (c) 2002-08 Peter Guntert. All rights reserved. ## 7MACROS: graf - CYANA macro ## ## Parameters: file=.ps (required) ## replace ## ## Convert a graphics file into a Postscript plot file. If file has the ## extension ".grf", nothing happens. Otherwise a Postscript file is produced ## from the corresponding graphics file with extension ".grf". If the option ## replace is set, then the graphics file is removed after the Postscript ## file has been produced. var i ext grf ps syntax $macro:file=@f.ps replace i=indexr('$file','.') ext='$file(i+1:)' grf='$file(1:i)grf' ps='$file(1:i)ps' if (.not.existfile(grf)) error "Graphics file \"$grf\" not found." if (ext.eq.'grf') then if (replace) print " Graphics file \"$file\" written." else plot ps $ps plot file $grf plot close if (ext.eq.'ps') then print " Postscript file \"$file\" written." else system "ps2$ext $ps" remove $ps print " Output graphics file \"$file\" written." end if if (replace) remove $grf end if