Tips for creating nice .eps files under Linux
we would like to:
(i) create light .eps files, not pixelized and with a bounding box.
(ii) create nice .eps filefrom free plotting software such as Gnuplot (2D
and 3D) or Xmgrace (2D).
(iii) use Latex fonts, or better, include Latex formulas in the plots.
Useful websites :
Languages and libraries specialized for files handling and interaction
with Operating System:
Useful Free softwares (manpages are particularly well documents):
- Postscript : wikipedia
- Adobe : fonts, postscript and pdf conventions.
- DejaVu : much smaller file sizes
than postscript and pdf, useful for archiving.
- gs : ghostscript, everything
- gv or ggv : to view .eps
files. Enables exportation to other formats (jpeg, pdf...).
: creates an .eps file from a .ps file but does not always work.
- dvips -E
: creates an .eps file from a .dvi file comming from a Latex source code.
Usually, the bounding box is not correctly generated so use fixbb to fix it.
: creates a .pdf from an .eps file.
- ps2pdf : creates .pdf
from .ps files.
- pdfTex :
writes pdf from Latex.
- xfig : vectorial drawing. Able to
generated .tex and .epic output.
- gnuplot : plotting 2D and 3D. Can
be interpreted by Latex.
- xmgrace : 2D Plotting.
Combined with psfrag, it is possible to include Latex formulas.
- latex : the best way to include Latex
fonts in your .eps file. PsTricks
- pstoedit : creates vectorial
format from PS or PDF.
: vectorial drawing software within the StarOffice distribution.
- skencil : vectorial drawing software.
Useful Non-Free softwares :
if you are working with a configuration of linux which has
not the dot "." as a standard format for floating points data
(for instance the coma "," in french), you can add the following
two lines in your .bashrc file:
this will make the job without too many side effects.
if you want to create a bounding box for an .eps file which
is not bounded, you can use the fixbb script (available in Bash+Awk here
or in Perl
$ ./fixbb foo.eps
- the results you'll have might depend on the configuration you have but the
methods are quite generic.
- the picture/epic/pstricks environments are a simple way to create nice and
light .eps files with Latex fonts. For instance you can construct the pyrochlore
from the tex file Pyrochlore.tex and the CreateEps
$ ./CreateEps Pyrochlore
this will create the bounded Pyrochlore.eps file.
- you can also use the Latex epic environment to constructs plots from data
with the help of an awk script to obtain:
which has nice
Latex fonts. This was created using :
$ gawk -f draw.awk local.dat
> Current_pattern_color.tex; CreateEps Current_pattern_color
The result is Current_pattern_color.eps.
- with Gnuplot, you can use the output redirection to .tex to include Latex
fonts in your .eps files such as in:
this file was created using:
$ gnuplot Chi0Map.gnu
where you need the Chi0Map.dat data file and also
the tot.tex file and the fixbb file.
You'll get the Plot.eps file.
- If you want to add Latex fonts to an .eps file created with Xmgrace. The
simplest way to do that is to use psfrag and to rebuild the .eps file with
latex and dvips. Here is what you can get:
from the BandsDiagram.agr file and using the
CreateEpsWithPSFrag script. The output file
- With Xfig, you can do the same tip with psfrag but, depending on your version
of Xfig, you can also generate some .tex file that you can compile with latex
followed by dvips. A problem with Xfig is that it has a discretization process
which lowers the quality of files. For instance, if you import an .eps file
as a picture into Xfig, you'll lost the vectorial nature of your original
file. Still, you can use the pstoedit
software to transform your .eps file into a correct Xfig file.
- You can merge two .eps file with Latex. For example, the picture
has been generated with an .eps file from Xfig and one from Latex using the
MergeEps script. The result is New_Gauges.eps.