2 # #############################################################################
4 # Usage: gp-ext-imp [options] [<input-file>] [<output-file>]
6 # A small script to produce half-useful bar graphs from the PostScript
7 # output produced by gnuplot.
8 # Translation is done in the X axis automatically, and should
9 # be `good enough' for graphs with smallish numbers of bars.
11 # Original version: Bryan O'Sullivan <bos@dcs.glasgow.ac.uk> 09.94
12 # New and improved version: Hans Wolfgang Loidl <hwloidl@dcs.glasgow.ac.uk>
15 # -w <width> ... width of vertical bars
16 # -g <gray-level> ... set gray-level (between 0 and 1; 0 means black)
17 # -m <move> ... move the graph <move> pixels to the right
18 # -h ... help; print this text
21 # #############################################################################
28 open(ME,$0) || die "Can't open myself ($0)";
40 $size = $opt_w ? $opt_w : 200;
41 $gray = $opt_g ? $opt_g : 0;
42 $move = $opt_m ? $opt_m : 150;
44 $from = $#ARGV >= 0 ? $ARGV[0] : "-";
45 $to = $#ARGV >= 1 ? $ARGV[1] : "-";
48 print 70 x "-" . "\n";
50 print " Input file: $from Output file: $to\n";
51 print " Width: $size Gray level: $gray Move is " .
52 ($opt_m ? "ON" : "OFF") . " with value $move\n";
53 print 70 x "-" . "\n";
56 open(FROM, "<$from") || die "$from: $!";
57 open(TO, ">$to") || die "$to: $!";
67 # This seems to shift everything a little to the right;
68 print TO "$move 0 translate\n";
70 print TO "$gray setgray\n";
71 print TO "$size setlinewidth\n";
76 print TO "-150 0 translate\n";