#!/usr/local/bin/perl -i # # gnuthicken.p takes a PS file written by gnuplot and modifies it # so that the line thicknesses for line types 0, 1, 2 are bigger # # gnuthicken1.p just thickens line type 1 (aka 0) # # NB, you can't do multiple files using mutate.p file file file # you have to do a foreach # # but if I undid the preamble thing it would probably still work fine. $shrink="0.5"; # eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; print STDERR "Dshrink ... " ; $preamble = 1 ; do { $_ = <> ; if ( /\/LT0\s\{/ ) { print '/BBL { stroke gnulinewidth 3 mul setlinewidth } def /BBBL { stroke gnulinewidth 4 mul setlinewidth } def /LT0 { BBBL [] 0 1 0 DL } def /LT1 { PL [2 dl 4 dl] 0 0 1 DL } def /LT2 { PL [2 dl 4 dl] 0 0 1 DL } def /LT3 { PL [1 dl 1.5 dl] 1 0 1 DL } def ' ; $_ = <> ; $_ = <> ; $_ = <> ; $preamble = 0 ; print STDERR "modified line thickness defns ... " ; } else { print; } } while ( $preamble ) ; while (<>) { print ; } print STDERR "done\n" ;