0

I have an .eps figure which I produced with PyPlot (~matplotlib) in Julia. I have converted it to pdf with epstopdf fig.eps When I include it in a document it is shifted up- and rightwards. Minimal code:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t]
\fbox{\includegraphics[width=8cm]{fig.eps}}
\fbox{\includegraphics[width=8cm]{fig.pdf}}
\end{figure}
\end{document}

The .eps file is not automatically converted by xetex in .pdf (I don't know why). The .pdf file is correctly placed, but I don't want to have to convert my .eps file outside latex. The .eps file is problematic in itself, I tried with older .eps files that I had and it works just fine, but I am unable to output new .eps files with PyPlot displaying correctly (I don't know why).

Output: enter image description here

Original .eps: https://ufile.io/2pfdk Converted .pdf: https://ufile.io/513ee

Is there a way to have xetex convert automatically .eps to .pdf so that they display correctly? Or is there a way to fix the faulty .eps files output by PyPlot? (Not really latex-related...)

  • 1
    I get this output with xelatex in texlive 2017, perhaps you just need to update your system? – David Carlisle Jul 7 '17 at 10:01
  • Your eps works fine for me too. Can you show your log-file? Perhaps you have some local settings that interferes. xetex converts eps on-the-fly to pdf (at every compilation), so it is normal that there is no pdf. – Ulrike Fischer Jul 7 '17 at 10:15
  • Thanks to both of you. Here is the log file: pastebin.com/wRUxFMpt I can try to update things on my system but I have an unstable Ubuntu (the upgrade to 16.04 kind of failed and I don't have the time currently to install everything back from scratch). Should I upgrade texlive-full? – G Viaud Jul 7 '17 at 10:44
  • You have a bit older LaTeX-format than me on my texlive 2015 (on windows), but beside this the file versions are identical and there is nothing suspicious to see that would explain why it fails for you. – Ulrike Fischer Jul 7 '17 at 12:33
  • maybe a bounding box error? You could try pdfcrop on the pdf file. – Michael Palmer Jul 7 '17 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.