Closed as not planned
Description
I tested this with the matplotlib master
import numpy as np
import matplotlib.pyplot as plt
plt.figure()
x = np.linspace(0.0, 1.0, 101)
y = x ** 2
plt.plot(x, y)
plt.title('sympy.lambdify\nwith UMFPACK')
plt.savefig('test.pgf')
Then compile this with a test.tex
\documentclass{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[scaled=0.8]{DejaVuSansMono}
\bibliographystyle{plain}
% \usepackage[all]{xy}
\usepackage{amsmath}
% for images: png, pdf, etc
\usepackage{graphicx}
% for matplotlib pgf output
\usepackage{pgfplots}
\begin{document}
\begin{figure}[!ht]
\centering
\resizebox{0.9\textwidth}{!}{\input{test.pgf}}
\label{fig:test}
\end{figure}
\end{document}
pdflatex test.tex
The resulting image looks like
If you save as another format, like png
, it is centered properly:
I can't reproduce it with all titles, so I'm not sure what exactly is going on with my specific title string.