I prepared a plot graphics with
set term post eps color solid font "Helvetica" 10
set output "plot.eps"
set multiplot layout 2,2
set size ratio 1
plot f(x)
plot g(x)
plot h(x)
plot i(x)
unset multiplot
unset output
and then I include the plot in latex with
\usepackage{graphicx}
...
\begin{figure}
\includegraphics{plot.eps}
\end{figure}
Is this the correct way to include gnuplot graphics in latex? What is
the difference between ps files and eps files?
How would I adjust the spacing between the plots? (they always come
out on A4 which leaves too much space between columns)
Can fonts sizes be controlled individually?
When I try to rotate my eps files on inclusion, the width does funny
things. Is there something I should know about postscript files to
make the width=\textwidth latex command work?
Thank you for ideas,
Anton
Stop right there.
If you are including *eps files in latex, then you should probably
be using the epslatex terminal rather than "set term post eps".
>\usepackage{graphicx}
>...
>\begin{figure}
>\includegraphics{plot.eps}
>\end{figure}
>
>Is this the correct way to include gnuplot graphics in latex? What is
>the difference between ps files and eps files?
>
>How would I adjust the spacing between the plots? (they always come
>out on A4 which leaves too much space between columns)
The "layout" keyword to "set multiplot" automatically chooses spacing.
But you don't have to use "layout"; you are free to specify any
placement you like for each component plot.
>Can fonts sizes be controlled individually?
Certainly.
>When I try to rotate my eps files on inclusion, the width does funny
>things. Is there something I should know about postscript files to
>make the width=\textwidth latex command work?
>
>Thank you for ideas,
>Anton
--
Ethan A Merritt
I now used the "size" option of "set term" to specify the correct
ratio. But I have put in the width of the latex \textwidth manually
and adjust the vertical spacing accordingly. Is there a more flexible
way? For example setting the width only and then let the height be
adjusted by whatever the plots use up? (with their set size ratio 1
setting)
Or maybe not even specifying the width, but let it be set on inclusion
in latex similarly to the \includegraphics[width=...]{...} option?
Is the absolute size of the eps file actually a fixed length in
inches?
Anton
> How would I adjust the spacing between the plots?
Try "help margin". It's pretty indispensable for multiplot, IMHO.
Spacing also indirectly depends on the default font size, which can be
set by, e.g., "set term post eps 12".
> (they always come
> out on A4 which leaves too much space between columns)
Not sure I understand what you mean. You already know about the size
option of the postscript terminal. If there is too much (or too little)
space around your plot, you can directly edit the eps-file and adjust
the line that sets the BoundingBox. One of the first lines of the eps
contains something like "%%BoundingBox: 50 50 390 170" which specifies
the coordinates of the lower left and upper right corner.
To automatize this process, I often use something like
system(sprintf('perl -i -pe "s/BoundingBox: 50 50 /BoundingBox:
30 30/" %s', outfile)
which would give me more space below and to the left of the plot
(assuming outfile is a variable that holds the name of your output file,
and you have perl installed).
> Can fonts sizes be controlled individually?
Yes, for example:
set xtics out font "Helvetica, 14"
set ylabel "y" font ", 20"
set label "abc" at 10, 20 font "Times-Italic, 22"
set key left font ", 10"
HTH,
Michael.