Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to use an .eps figure for my paper, but the problem comes when I got weird output.

I use this command:


But on the output, the figure is rotated by itself. A.eps is a landscape figure, but it came out as a portrait figure.

I tried to rotate it so it might be come out as I want, but it did not work.

Can anybody help me, please?

share|improve this question
try pspdf -dAutoRotatePages=/None myfile.dvi and if this dows not help, then provide your eps file –  Herbert Feb 8 '11 at 16:21
Thank you for your reply..So, did you mean that the figure in dvi file will still rotated, then when you make that command line, the figure in pdf file will come out as I want? But I've tried it, it still doesn't work. –  user3437 Feb 8 '11 at 17:55

4 Answers 4

up vote 3 down vote accepted

From comments to a different answer, I gather that you want to include plots generated with gnuplot.

Gnuplot comes with many different "terminals", which are output filters that generate different file formats. A common one is postscript (which generates postscript files), or png for generating PNG raster images. If you build your plots interactively from a gnuplot command line, you are probably using the wxt terminal, which outputs the plots to your screen.

For including gnuplot plots in LaTeX documents, there are other terminals that are better suited than the terminals which generate standalone image files, because they let LaTeX take care of typesetting the text:

  • The epslatex terminal generates two files: One .tex file that includes all of the text and numbers, and one .eps file that includes the graphics.
    To use it, do the following: After setting up your plot as usual (by using a sequence of setup commands or by loading a gnuplot file) issue the command set terminal epslatex color at the gnuplot> prompt; then set out "filename.tex"; replot (or just plot followed by the function, if that is all you need); and finally set out without a file name, which closes the files. You have now generated the .tex and .eps files.
    In your LaTeX document, you just include the graph using \input{filename}, the .eps file will be included automatically. If you want a bigger font size, just use \large{\input{filename}} instead.

  • The tikz terminal generates a .tex file that contains TikZ code to generate the graph directly in LaTeX.
    To use it, you use set terminal tikz, after that the procedure is identical to that for the epslatex terminal. In your LaTeX document you must also load the gnuplot-lua-tikz package.

Here's a complete example using the epslatex terminal:
In gnuplot:

gnuplot> set terminal epslatex color
Terminal type set to 'epslatex'
Options are '   leveldefault color blacktext \
   dashed dashlength 1.0 linewidth 1.0 butt noclip \
   palfuncparam 2000,0.003 \
   noheader "" 11 '
gnuplot> set out "epslatexfile.tex"
gnuplot> set samples 400, 400
gnuplot> plot [-10:10] real(sin(x)**besj0(x))
gnuplot> set out

A minimal LaTeX document to include the output from gnuplot could look like this:


Yielding this output:

gnuplot plot with epslatex terminal

share|improve this answer
thank you a lot! it solved the rotating problem! But I have another problem now. The x-y-axis have no value written. I tried to set the xtics and ytics, but it does not work. Can you help me again? –  user3437 Feb 9 '11 at 0:06
actually, there is nothing in line title too. I tried the \large{\input{filename}}, then the line's title is out. Not with the xy-axis. Also the figure is also large. It is not only the font. –  user3437 Feb 9 '11 at 0:13
@sora: The fontsize commands (\large, \Large, and so on) can not influence the size of the picture, because that is in an .eps file. Try including the picture into the same document with and without \large, and you will see that the size of the graph itself does not change. If you want to change the size of the graph, use terminal epslatex color size 7cm,5cm to set the canvas size to 7cm x 5cm. About the problems with the missing tick marks and the missing line title, maybe it's easier if you open a new question for that where you include your gnuplot code. –  Jake Feb 9 '11 at 7:14
thank you. I will try it, and if it is not work, I will open new question. Since I tried to include another eps file which I converted from png, and there is no problem with it. So it really is the problem with gnuplot. Thank you very much! –  user3437 Feb 9 '11 at 7:38

I just had similar issues with rotating eps figures. Check out this thread: On Ubuntu 10.10 with texlive-full installed, xelatex is rotating my figures 90 degrees counterclockwise

share|improve this answer
the rotate command doesn't work too for my case.. –  user3437 Feb 8 '11 at 17:54

Just a general comment from someone who doesn't use LaTeX often:

graphicx with its \includegraphics is generally preferable to epsfig and PDF is generally to be preferred over EPS.

\includegraphics allows you to leave the image format open in the LaTeX source code, and to pick PDF instead of EPS by using pdflatex instead of latex (once you've converted your images to PDF). This has saved me a few headaches in the past.

share|improve this answer
thank you for your reply. I also have tried to convert the eps file to pdf. But the figure itself change. I need a bigger font for my figure (so I use enhanced command on gnuplot, which not used for png file, only eps file). But when I convert it to pdf, the font is even became smaller than the png file. So I think I really need to use esp figure. –  user3437 Feb 8 '11 at 16:19
It depends. The conversion problems will recur if you need to convert the resulting document to PDF. You really don't want to see problems that late. This is one reason I prefer using pdflatex nowadays. The underlying problem is that EPS is quite an undisciplined format. –  reinierpost Feb 8 '11 at 16:35
@sora: If you're using gnuplot, why not use the epslatex terminal? That way, you can control the font size using normal LaTeX commands (in your main document), and it looks neater too, as the text will be typeset the same way as the rest of the document. For example, you could just include the .tex file generated with the gnuplot epslatex terminal using "\Large{\input{<filename>}}". –  Jake Feb 8 '11 at 16:41
I never use epslatex terminal before. Is it similar with gnuplot?(the language or else) –  user3437 Feb 8 '11 at 17:53
@sora: the epslatex terminal is a part of gnuplot. I've added an answer explaining how to use it. Also, if you want me to be notified of one your comments, write @Jake in your comment. –  Jake Feb 8 '11 at 19:24

If you are using dvipdf then try making your command line

dvipdf -dAutoRotatePages=/None myfile.dvi
share|improve this answer
Thank you for your reply..So, did you mean that the figure in dvi file will still rotated, then when you make that command line, the figure in pdf file will come out as I want? But I've tried it, it still doesn't work. –  user3437 Feb 8 '11 at 15:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.