how to center matlab .eps figure in latex document

徘徊边缘 提交于 2019-12-11 03:22:03

问题


I created .eps file from matlab figure using the export setup option in the matlab figure File menu, and then pressing the export button in the opened dialog box. In Latex document I added the next lines:

\begin{figure}[H]
    \begin{center}          
        \includegraphics[width={0.7\textwidth}]{loglogRateVsIntensity.eps}
        \caption{Rates}
        \label{fig:ratesVersusIntensity}
    \end{center}
\end{figure}    

The Figure indeed appears in the document, but not centered and also with excessive amount of space preceding it, and part of it is covering the next lines of the document. I have included to the Latex document: \usepackage{float} in order to have figures appear right where I place them in the latex document, but some how for this .eps figure this command is being ignored.

Any ideas what can I do to get it fixed ???


回答1:


I strongly recommend export_fig. It works like a charm.

To export the current figure as file_name.eps write (requires ghostscript and pdftops -> explained under the link above):

export_fig file_name -eps

export_fig gets also rid of the space preceding the image. I think the formatting of the image should also solve the centering problem in latex.

Cheers



来源:https://stackoverflow.com/questions/30891582/how-to-center-matlab-eps-figure-in-latex-document

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!