My lines or labels show up with too thin a line when I convert to PostScript plot. How can I make them thicker?
This plot has three different line thicknesses in Ferret | But when translated to PostScript all the lines look thin |
![]() |
![]() |
Run Ferret to generate a plot, then from the Unix command line translate it to a PostScript plot:
% ferret
yes? SET MODE META
yes? PLOT/LINE=1/I=1:15/TITLE="Three curves" 1./i
yes? PLOT/LINE=7/I=1:15/OVER 1./(i-2)
yes? PLOT/LINE=13/I=1:15/OVER 1./(i-3)
yes? quit
% Fprint -R -o three.ps metafile.plt
On very high resolution printers (1200 dpi), and some display tools it is difficult for the eye to differentiate single, double, and triple pixel thick lines. They all appear "thin". To solve the problem we need only thicken the lines by more than the normal amount. This can accomplished through modifying the PostScript file (filename.ps) before sending it to the printer or through modifications to the Ferret metafile (filename.plt) before converting it to PostScript with Fprint or gksm2ps.
3000 div setlinewidth to 1000 div setlinewidthwill make ALL the lines in the plot three times thicker, including the text and axes. This will differentiate the three lines, making the plot look like the one on the left above.
#!/bin/csh -f # Usage: ps_thicken ps_file factor # Thickens lines in a PostScript file by changing the linewidth macro, # Result goes to standard output. # get list of all arguments set args = ($*) # if not enough arguments, complain. if ($#args < 2) then echo "Usage: ps_thicken ps_file factor" echo "Thickens all lines in a PostScript file by changing the linewidth macro." echo "Result goes to standard output." exit 1 endif sed -e "s/^\/lw {\(.*\) div setlinewidth/\/lw {$2 mul \1 div setlinewidth/" $1
% chmod +x change_widths % change_widths metafile.pltApplying the change_widths script to a metafile will have the effect of doubling the thickness of lines generated with PLOT+ pen numbers 7 and 13 (or equivalently /COLOR=BLACK/THICK=2 and /COLOR=BLACK/THICK=3, respectively).
change_widths will result in the new file metafile_thick.plt.
% change_widths metafile.plt % Fprint -R -o thickplot.ps metafile_thick.pltUpon converting the metafile to PostScript via Fprint as usual, the result also looks like the plot on the left above.
. . . 51 29 1 1 1.00000 1 51 29 7 1 2.00000 1 <-- we'll change this line 51 29 13 1 3.00000 1 51 29 2 1 1.00000 2 51 29 8 1 2.00000 2To double the thickness only of /LINE=7 (the double thick black plotting line), while leaving all other lines unaffected, change
51 29 7 1 2.00000 1 to 51 29 7 1 4.00000 1The double thickness, "2.00000" is changed to quadruple thickness "4.00000" in the GKS metafile -- then the PostScript is generated as usual.
A similar approach can be used to change the thickness of any of the
lines. The mapping through which line color and thickness determine the
pen number in the metafile can be found in the
Ferret Users Guide
(Chapter6, sec 1.5.2) . Pens 0-6 are thin (nominal thickness "1.00000"),
7-13 are double (nominal thickness "2.00000"), and 14-20 are triple
(nominal thickness "3.00000"). Suppose you want to change /thick=2/color=red
(pen 8) from double to triple thick and /thick=3/color=black (pen 14)
from triple to 5x. Edit the file or use a Unix shell command, "sed" substitution, to
accomplish this. (The command is one long command line.)
sed -e "s/51 29 8 1 2.00000/51 29 8 1 3.00000/" -e "s/51
29 14 1 3.00000/51 29 14 1 5.00000/"
Typically one wants to redirect the output to a new file, so the full
command becomes
sed -e "as above" metafile.plt > new_metafile.plt
Last modified: Oct 23, 2000