[Tex/LaTex] How to ensure equal font sizes in all included TikZ/pgfplots figures

pgfplotstikz-pgf

I would like to have many tikzpictures in my document. Since each tikzpicture has its own size, I don't know how to manage the font size among all the pictures. Some of tikzpictures are of size \textwidth, some are 0.5\textwidth, and some are 0.4\textwidth. Could someone help me find the best way to have all the font sizes of the ticks, labels, and texts of the picture the same size? When I look at the document, I don't see a consistency among the pictures. How can I standardize all the pictures? I would love to have other's opinions.

As an exmaple, suppose the following pictures.

enter image description here

As can be seen, there are different font size after scaling the tikzpicture to 0.5 and 1.0. For scale=0.5, it is hard to read the picture. Having said this, suppose there are two completely different pictures in a document. How should I force the font size of these two pictures the same? In my document, one picture has the x-axis range from 1 to 10 and another one is 2 to 3. In order to accomodate the picture for example I have to use 0.5\textwidth. I want to have for example the font size of the xtick and ytick to be the same for all the pictures in my document. I am looking for a way to achieve this goal.

Best Answer

Based on the way you are creating such plots in your other posts, you can pass a width option to your axis command, which will scale the plot to the specified width without affecting the text.

Sample output

% arara: pdflatex: { shell: yes }
\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.7}

\begin{document}

\begin{tikzpicture} 
    \begin{axis}[width=5cm,
        axis on top,
        xmin=-1, xmax=1,
        ymin=-1, ymax=1,
        view={0}{90},
        xlabel = {$x$},
        ylabel = {$\sigma$},
        ]
        \addplot3[
                contour gnuplot = {contour label style={
                            nodes={text=black},
                            /pgf/number format/fixed,
                            /pgf/number format/fixed zerofill=true,
                            /pgf/number format/precision=1,}},
                contour/draw color={black},
                contour/label distance=1000pt,
        ]
        {exp(-(x^2+y^2)};
    \end{axis}
  \end{tikzpicture}
  \begin{tikzpicture}
    \begin{axis}[width=5cm,
        axis on top,
        xmin=0, xmax=4,
        ymin=0, ymax=3,
        view={0}{90},
        xlabel = {$x$},
        ylabel = {$\sigma$},
        ]
        \addplot3[
                contour gnuplot = {contour label style={
                            nodes={text=black},
                            /pgf/number format/fixed,
                            /pgf/number format/fixed zerofill=true,
                            /pgf/number format/precision=1,}},
                contour/draw color={black},
                contour/label distance=1000pt,
        ]
        {exp(-(x^2+y^2)};
    \end{axis}
\end{tikzpicture}

\end{document}