Usage¶
To use the class import it to your code and call before start plotting:
from mpl2tex import RcParams
RcParams()
To include the figure in your TeX document save it as pgf
and write in
your TeX code:
\begin{figure}
\centering
\input{<filename>.pgf}
\caption{Sinus and cosinus function generated with Matplotlib and mpl2tex}
\end{figure}
Make sure to load the required pgf
package in your preamble. If you
save the figure not in your document’s root directory you can use the
import
package:
\begin{figure}
\centering
\import{<path to file>}{<filename>.pgf}
\caption{Sinus and cosinus function generated with Matplotlib and mpl2tex}
\end{figure}