Graphics, Figures & Tablesproblems with matlab *.eps files

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
carleslatex
Posts: 3
Joined: Tue Mar 02, 2010 12:19 pm

problems with matlab *.eps files

Post by carleslatex »

Hi everybody:
I have problems in viewing figures created in Matlab (exported to *.eps format) in PDF documents. I'm working with WinEdt. Everything is fine after compiling to obtain *.dvi file. Problems arise when converting *.dvi file to *.pdf file: their left side appear cut (between 1-2 cm). Does any of you know what could be the reason for this?
Here is an example:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt,a4paper,oneside,openright,openbib,spanish]{report}
\usepackage[dvips]{graphicx}
\begin{document}
\begin{figure}[!h]
\includegraphics[width=15cm]
{C:/red/blue/green/tesi_doctoral/latex/figures/cap8/1D_delta_prog.eps}
\centering\caption{}
\label{fig:1D_delta_prog.eps}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Thank you very much,
Carles

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

problems with matlab *.eps files

Post by localghost »

Please read entirely and carefully our topic with very important information [1]. It will show you some critical points. It's in your own interest that you pay attention to the given hints.

Reading your description one sentence catches my eye.
carleslatex wrote:[...] Problems arise when converting *.dvi file to *.pdf file: their left side appear cut (between 1-2 cm). [...]
Be more precise in describing your conversion process. It's said to cause problems in some cases when converting from DVI directly to PDF. The route via PS seems to be more reliable.

[1] View topic: Avoidable mistakes


Best regards and welcome to the board
Thorsten
carleslatex
Posts: 3
Joined: Tue Mar 02, 2010 12:19 pm

Re: problems with matlab *.eps files

Post by carleslatex »

Thanks very much Thorsten for your answer. I'll try to be more careful in posting questions.
As I said before, I'm using WindEdt. When I'm compiling the *.tex file to get a *.dvi file I obtain precisely what I was looking for. However, when I want to obtain a *.pdf version (by dvi2pdf) some figures made Matlab (7.X) and exported to *.eps appear cut: a vertical stripe of 1-1.5 cm width covering the overall height of the figure of its left side is not shown in the pdf file.
I tried, as you told me, to convert first to ps and then to pdf but I should have a problem with WindEdt configuration that I'm not able to understand. It is something related to Ghostscript that is not installed in my computer and, as I see, does not depend on my Tex system, right?. Here is the message I get:

****************************************************
GS-Bin: (gswin32c.exe): not Found
****************************************************
Ghostscript is used mainly to handle graphics (ps and eps files) and to convert ps files to pdf. Without it your TeX system may have a limited ability to display graphics but the basic functionality is not affected by its absence. It is recommended that you install Ghostscript and GSView to enhance the capabilities of your TeX system. A link is available on TUG's (www.tug.org) site. If GS is installed make sure that its BIN directory is on your PATH. WinEdt did not find any trace of installed GS in Windows Registry. If necessary, enter the GS Binary Folder manually in the Ghostscript Tab Page of the Execution Modes interface. Depending on your version of GS disable the Auto Detection and enter something like:

C:\Program Files\gs\gs8.54\bin

****************************************************
Thank you again.
Regards,
Carles
carleslatex
Posts: 3
Joined: Tue Mar 02, 2010 12:19 pm

Re: problems with matlab *.eps files

Post by carleslatex »

Dear all:
I already have solved the problem. It was just installing Ghostscript.
Thanks,
Carles
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

problems with matlab *.eps files

Post by localghost »

I wonder if there's no function in Matlab to export your charts and diagrams directly as PDF. If not, search the forum for »epstopdf« to get solution for converting your EPS file to PDF and their inclusion when compiling with pdflatex. This would also need Ghostscript installed.
Post Reply