Graphics, Figures & TablesEPS imported to LaTeX, title not centered

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

EPS imported to LaTeX, title not centered

Post by BastienBastien »

Good evening LaTeX2e users,

I export some plots from Matlab via the command:
print -depsc2 myfigure111
Then I import them in LaTeX via:
\begin{figure}
	\centering
	\includegraphics[scale=0.40,angle=0]{pictures/myfigure111}
	\caption{Simulation blablabla}
\end{figure}
Everything is okay, but the title is is not centered (top of the figure, but on the left side).
In Matlab the plot title is perfektly centered! (top of the figure, and on the middle of the figure).

Have you got an idea?

Regards,
Me

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

thomasb
Posts: 134
Joined: Thu Aug 03, 2017 10:54 am

EPS imported to LaTeX, title not centered

Post by thomasb »

Well, I would answer to remove the title and make your own... Does this suit you ?
BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

EPS imported to LaTeX, title not centered

Post by BastienBastien »

This would be a workaround, but I guess there is an elegant solution.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10329
Joined: Mon Mar 10, 2008 9:44 pm

EPS imported to LaTeX, title not centered

Post by Stefan Kottwitz »

That's clearly a Matlab export issue. LaTeX doesn't change the content of an image when it's included. Though Matlab displays it centered, it generates an export EPS file where it's not centered any more.

As Thomas suggested, you can remove the title and add it via LaTeX, or fix the image using an image editor.

Stefan
LaTeX.org admin
BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

EPS imported to LaTeX, title not centered

Post by BastienBastien »

Many thanks you two.
thomasb
Posts: 134
Joined: Thu Aug 03, 2017 10:54 am

EPS imported to LaTeX, title not centered

Post by thomasb »

So how did you do, how did you do ?!? :shock:
Post Reply