[Thread Prev][Thread Next][Index]
Re: [ferret_users] Ferret gksm2ps
william s. kessler wrote:
> I have the same problem and also don't know how to get rid of these
> lines. It is very unfortunate, and I think it is deeply embedded in
> the way Ferret does color-filled plots. A klugey workaround is to
> make a gif plot at very large size. That is often sharp enough that
> it can be reduced to normal size and still appear crisp. But it is
> not a very good solution.
This problem is due to antialiasing in your viewing/converting program
that displays postscript on screen or writes it to a bitmap file. I
can reproduce the lines by opening a Ferret-generated postscript file
with 'gv' in linux. If I turn antialiasing on, it will show the
stripes. If I turn it off, the fonts appear 'pixelated' on screen, but
the graphics look fine. The postscript file will print fine no matter
what option I use - this is only relevant for bitmapped images.
I convert my Ferret postscript to .eps and .png with the following
commands:
ps2epsi ferret_output.ps ferret_output.eps
convert +antialias -density 300x300 ferret_output.eps ferret_output.png
If I remove the +antialias option, I get the stripes in the output png
as well. Attached is my 'fprint' script which automates everything -
just do the following from inside ferret:
set mode metafile
! make plot here
cancel mode metafile
spawn fprint my_plot.eps ! produces both .eps and .png
If you rename or symlink the script so it's called "rfprint" it will
automatically remove the the metafile.plt files that are left behind.
Rename or link the script to "bwprint" and "rbwprint" to achieve the
same for black/white plots, e.g.:
spawn rfprint my_plot.eps ! also removes metafile.plt
I hope that solves your problem.
Cheers,
Hein Zelle
--
Unix is user friendly. It's just very particular about who
it's friends are.
Hein Zelle hein@icce.rug.nl
http://www.icce.rug.nl/~hein
#!/bin/tcsh
set inputfn="metafile.plt"
set outputfn="output.ps"
set myname=`basename $0`
set convert=ps2epsi
set makepng="convert +antialias -density 300x300"
if ($1 == "-h" || $1 == "--help") then
echo ""
echo "Usage: $myname [input.plt] <output.[e]ps>"
echo " Input is optional, 'metafile.plt' assumed by default."
echo " If no arguments are given, values are requested interactively."
echo ""
echo "Converts a Ferret metafile to (encapsulated) postscript, and"
echo "sets a proper boundingbox."
if ($myname == "rfprint") then
echo "Input file is removed after processing."
endif
echo ""
exit 0
endif
if ($1 == "") then
# no arguments, ask interactively
echo -n "enter input filename [metafile.plt] ? "
set tmpin = $<
if ($tmpin != "") set inputfn = $tmpin
echo -n "enter output filename [output.eps] ? "
set tmpout = $<
if ($tmpout != "") set outputfn = $tmpout
else
if ($2 == "") then
# one argument
set outputfn = $1
else
# two arguments (or more)
set inputfn = $1
set outputfn = $2
endif
endif
if ($myname == "bwprint" || $myname == "rbwprint") then
echo -n "Fprint -l ps -R -o $outputfn $inputfn ... "
Fprint -l ps -R -o $outputfn $inputfn
else
echo -n "Fprint -l cps -R -o $outputfn $inputfn ... "
Fprint -l cps -R -o $outputfn $inputfn
endif
echo "done."
#echo "psfixbb $outputfn ... "
#psfixbb $outputfn
#echo "done."
# set epsfile=`basename $outputfn .ps`.eps
set epsfile=${outputfn}.tmp
set pngfile=`dirname $outputfn`/`basename $outputfn .eps`.png
#echo -n "$convert $outputfn EPS:$epsfile ... "
#$convert $outputfn EPS:$epsfile
echo -n "$convert $outputfn $epsfile ... "
$convert $outputfn $epsfile
mv $epsfile $outputfn
echo -n "$makepng $outputfn $pngfile ... "
$makepng $outputfn $pngfile
echo "done."
if ($myname == "rfprint" || $myname == "rbwprint") then
echo -n "rm $inputfn ... "
rm $inputfn
echo "done."
endif
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement