# Matplotlib2tikz text size when scaling

I am using matplotlib with matplotlib2tikz to create my output. I am currently using the option to be flexible later on in TeX

tikz_save('myfile.tikz',
figureheight = '\\figureheight',
figurewidth = '\\figurewidth'
)


In TeX, I also use \usepackage{tikzscale}

When I import the .tikz-file into my TeX-document, I have some options for scaling. The easiest example with

\setlength\figureheight{\linewidth}
\setlength\figurewidth{\linewidth}

\begin{figure}
\includegraphics[width=\linewidth]{Grafiken/Kreuzkorrelation/myfile.tikz}
\end{figure}


will lead to a picture slightliy larger than \linewidth, which is then downscaled to \linewidth by tikzscale. Without tikzscale, when changing \begin{tikzpicture}[scale=.5], my tikz image PLUS text will get scaled down to half the size. The same happens now when using tikzscale the text will be slightly smaller.

This in particular does not bother me too much. However, what disturbs me, is that I do not know, how to handle text size. Playing around with length, width and scale will result in all sorts of combinations, but compared to the default text size, my image text size will never be the same. This is espacially annoying for subplots, I would call within my TeX document. In the end, subplot text size will differ hugely from normal figure and text size.

My question therefore is: Is there are a way to handle figure size of tikz-images from matplotlib2tikz, without altering the font size?

• Have you tried \pgfplotsset{width=\textwidth, height=\textheight} for figure scaling? – homocomputeris May 31 at 22:17