如何使 pgfplots 中的字体大小看起来一致

如何使 pgfplots 中的字体大小看起来一致

我使用 pfgplot 绘制了数据,如输出图像所示。字体大小似乎不一致。即使不一致,我如何才能减小下标“I”和“R”的大小。

\documentclass{standalone}
\usepackage{amsmath}
\usepackage{pgfplots}


\begin{document}
\begin{tikzpicture}[scale = 1]
    \begin{axis}[
            axis x line = middle,
            axis y line = middle,
            xlabel  = {$t$},
            ylabel = {$x_{R}(t)$},
            every axis x label/.style={
                at={(ticklabel* cs:1)},
                anchor=west,
            },
            every axis y label/.style={
                at={(ticklabel* cs:1)},
                anchor=south,
            },
            font = \tiny,
            xmin = 0,
            xmax = 12,
            enlarge x limits = 0.15,
            axis line style = {very thin},
            ymin = -2,
            ymax = 2,
            xtick = {\empty},
            ytick = {\empty},
            extra x ticks={7},
            extra x tick labels={$\tau$},
            axis line style = {black},
            width = 7cm,
            height = 4cm,
            mark size = 1pt,
            ]
\addplot[black,smooth]table{Real.txt};
\addplot [only marks,samples at={7},inner sep=2pt] {1.2} node[pin=0:{$x_{R}(\tau)$}]{};
\addplot [no marks,dashed]coordinates {(7,0)(7,1.2)};
    \end{axis}
\end{tikzpicture}


\begin{tikzpicture}[scale = 1]
\begin{axis}[
axis x line = middle,
axis y line = middle,
xlabel  = {$t$},
ylabel = {$x_{I}(t)$},
every axis x label/.style={
    at={(ticklabel* cs:1)},
    anchor=west,
},
every axis y label/.style={
    at={(ticklabel* cs:1)},
    anchor=south,
},
font = \tiny,
xmin = 0,
xmax = 12,
enlarge x limits = 0.15,
axis line style = {very thin},
ymin = -2,
ymax = 2,
xtick = {\empty},
ytick = {\empty},
extra x ticks={7},
extra x tick labels={$\tau$},
axis line style = {black},
width = 7cm,
height = 4cm,
mark size = 1pt,
]
\addplot[black]table{Imag.txt};
\addplot [only marks,samples at={7},inner sep=2pt] {1} node[pin=0:{$x_{I}(\tau)$}]{};
\addplot [no marks,dashed]coordinates {(7,0)(7,1)};
\end{axis}
\end{tikzpicture}
\end{document}

输出

答案1

如果你使用

\documentclass{article}

\begin{document}

\tiny
$x_R$

\end{document}

然后 R 看起来很大,因为 x 和 R 都是 5pt

在此处输入图片描述

由于乳胶具有

 \DeclareMathSizes{5}{5}{5}{5}

所以如果你添加

 \DeclareMathSizes{5}{5}{3}{3}

然后它将使用 3pt 文本(可怜你的读者:-),除非计算机现代会给出警告

LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <3> not available
(Font)              size <5> substituted on input line 7.

因此添加

\RequirePackage{fix-cm}

允许任何大小

\RequirePackage{fix-cm}
\documentclass{article}
\DeclareMathSizes{5}{5}{3}{3}

\begin{document}

\tiny
$x_R$

\end{document}

在此处输入图片描述

相关内容