我怎样才能更改 xy 标签上的字体大小

我怎样才能更改 xy 标签上的字体大小

我有以下从这里复制的代码如何在 LaTex 中绘制单位双曲线?,然后旋转它。轴标签字体太大。查看手册和多篇帖子,我无法解决我的问题。我尝试将 {font size=tiny 放在不同位置,但没有任何变化。如能提供帮助,我们将不胜感激。

\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=5cm,compat=1.12}
% axis style, ticks, etc
\pgfplotsset{every axis/.append style={font=\tiny}{
axis x line=middle,    % put the x axis in the middle
axis y line=middle,    % put the y axis in the middle
axis line style={->}, % arrows on the axis
`xlabel={\footnotesize$x^{'}$},          % default put x `on x-axis
                ylabel={\footnotesize$y^{'}$},{font=\tiny}          % 
default put y on y-axis
                rotate=40.0}}
% arrows as stealth fighters
\tikzset{>=stealth}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[
            xmin=-5,xmax=5,
        ymin=-5,ymax=5]
        \addplot [red,domain=-2:2] ({cosh(x)}, {sinh(x)});
    \addplot [red,domain=-2:2] ({-cosh(x)}, {sinh(x)});
    \addplot[red,dashed] expression {x};
    \addplot[red,dashed] expression {-x};
\end{axis}
\end{tikzpicture}

\end{document}

答案1

您可以使用和来修改和的labels字体大小tick labelslabel style={font=\tiny}tick label style={font=\tiny}

\documentclass[tikz]{standalone}
\usepackage{pgfplots}

% axis style, ticks, etc
\pgfplotsset{every axis/.append style={
                    axis x line=middle,    % put the x axis in the middle
                    axis y line=middle,    % put the y axis in the middle
                    axis line style={<->}, % arrows on the axis
                    xlabel={$x$},          % default put x on x-axis
                    ylabel={$y$},          % default put y on y-axis
                    label style={font=\tiny},
                    tick label style={font=\tiny}  
                    }}

% arrows as stealth fighters
\tikzset{>=stealth}

\begin{document}

\begin{tikzpicture}
    \begin{axis}[
            xmin=-5,xmax=5,
        ymin=-5,ymax=5]
        \addplot [red,thick,domain=-2:2] ({cosh(x)}, {sinh(x)});
        \addplot [red,thick,domain=-2:2] ({-cosh(x)}, {sinh(x)});
        \addplot[red,dashed] expression {x};
        \addplot[red,dashed] expression {-x};
    \end{axis}
\end{tikzpicture}

\end{document}

相关内容