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

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



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?

Thanks for your time.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.