2

考虑以下示例:

\documentclass{article}

\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{subcaption}
\usepgfplotslibrary{patchplots}

\begin{document}
\begin{figure}
    \begin{subfigure}{0.33\textwidth}
        \centering
        \begin{tikzpicture}
           \pgfplotsset{%
                width=\linewidth,
                height=\linewidth
            }
            \begin{axis}[ticks=none,
            xmin=0,   xmax=1,
            ymin=0,   ymax=1,
            axis x line=bottom,
            axis y line=left,
            ]
            \addplot[
            patch,mesh,
            patch type=quadratic spline, 
            style=very thick,
            color=black]
            coordinates {
                (0,0) (0.9,0.9) (0.5,0.5^2)
            };
            \addplot[mark=none, color=gray] {x};
            \end{axis}
        \end{tikzpicture}
    \end{subfigure}
    \begin{subfigure}{0.33\textwidth}
        \begin{tikzpicture}
           \pgfplotsset{%
                width=\linewidth,
                height=\linewidth
            }
            \begin{axis}[ticks=none,
            xmin=0,   xmax=1,
            ymin=0,   ymax=1,
            axis x line=bottom,
            axis y line=left,
            ]
            \addplot[
            patch,mesh,
            patch type=quadratic spline, 
            style=very thick,
            color=black]
            coordinates {
                (0,0) (0.9,0.9) (0.5,0.5)
            };
            \addplot[mark=none, color=gray] {x};
            \end{axis}
        \end{tikzpicture}
    \end{subfigure}
    \begin{subfigure}{0.33\textwidth}
        \begin{tikzpicture}
           \pgfplotsset{%
                width=\linewidth,
                height=\linewidth
            }
            \begin{axis}[ticks=none,
            xmin=0,   xmax=1,
            ymin=0,   ymax=1,
            axis x line=bottom,
            axis y line=left,
            ]
            \addplot[
            patch,mesh,
            patch type=quadratic spline, 
            style=very thick,
            color=black]
            coordinates {
                (0,0) (0.9,0.9) (0.45,0.65)
            };
            \addplot[mark=none, color=gray] {x};
            \end{axis}
        \end{tikzpicture}
    \end{subfigure}
    \caption{Caption}
    \label{fig:my_label}
\end{figure} 
\end{document}

我本来希望我的三个地块分别占据页面宽度的 1/3,并位于彼此相邻的一行上。相反,我得到了这个:在此处输入图像描述

它们不仅比预期的小,而且即使它们更小,由于某种原因,它们似乎不适合放在一条线上,而是放在两条线上。这是怎么回事‽</p>

4

0 回答 0