将乳胶图表放入子标题网格中

将乳胶图表放入子标题网格中

我想知道是否可以将乳胶图排列成网格。

我知道可以使用 subcaption 包来排列图形:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}

\begin{figure}
\centering
\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-a}
\caption{A mouse}\label{fig:mouse}
\end{subfigure}

\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{A gull}\label{fig:gull}
\end{subfigure}
\begin{subfigure}[b]{.45\linewidth}
\includegraphics[width=\linewidth]{example-image-c}
\caption{A tiger}\label{fig:tiger}
\end{subfigure}
\caption{Picture of animals}
\label{fig:animals}
\end{figure}

\end{document}

但是我的图表的格式是

\pgfplotstableread[col sep = comma]{tables/txy/fine/vel/p1.csv}\txyone

\begin{figure}
\begin{tikzpicture}
  \begin{axis}
    [
    title={location pos 1 inlet x},
    scale only axis,
    legend pos = outer north east,
    xlabel=U (m/s), 
    ylabel=Y/S (inches),
    xmin = 0,
    xmax = 12,
    ymin = 0,
    ymax = 10,
    x dir=reverse,
    xmajorgrids=true,
    grid style=dashed,
    ]
    \addplot[domain=1:1e4,color=blue, smooth] table[x = x1, y = y2]{\txyone};
    \legend{Laminar, k-$\epsilon$ realizable, k-$\omega$, SST, RSM,}
    \legend{}
  \end{axis}
\end{tikzpicture}
\caption{initial inlet x dir}
\end{figure}

我尝试\includegraphics[]{}用图表的代码替换,但是没有用

有没有办法将 tikzpicture 图形插入为子标题网格?

答案1

好的,我成功了。如果其他人遇到同样的问题,以下是我使用的格式

\documentclass[12pt]{article}
\usepackage{pgfplots}
\usepackage{subcaption}

\usepackage{graphicx}


\begin{document}

\pgfplotstableread[col sep = comma]{tables/txy/fine/vel/p1.csv}\txyone

\begin{figure}
\begin{subfigure}[b]{.45\linewidth}
\begin{tikzpicture}
  \begin{axis}
    [

    ]
    \addplot[domain=1:1e4,color=blue, smooth] table[x = x1, y = y2]{\txyone};
    \legend{Laminar, k-$\epsilon$ realizable, k-$\omega$, SST, RSM,}
    \legend{}
  \end{axis}
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[b]{.45\linewidth}
\begin{tikzpicture}
  \begin{axis}
    [

    ]
    \addplot[domain=1:1e4,color=blue, smooth] table[x = x1, y = y2]{\txyone};
    \legend{Laminar, k-$\epsilon$ realizable, k-$\omega$, SST, RSM,}
    \legend{}
  \end{axis}
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[b]{.45\linewidth}
\begin{tikzpicture}
  \begin{axis}
    [

    ]
    \addplot[domain=1:1e4,color=blue, smooth] table[x = x1, y = y2]{\txyone};
    \legend{Laminar, k-$\epsilon$ realizable, k-$\omega$, SST, RSM,}
    \legend{}
  \end{axis}
\end{tikzpicture}
\end{subfigure}
\begin{subfigure}[b]{.45\linewidth}
\begin{tikzpicture}
  \begin{axis}
    [

    ]
    \addplot[domain=1:1e4,color=blue, smooth] table[x = x1, y = y2]{\txyone};
    \legend{Laminar, k-$\epsilon$ realizable, k-$\omega$, SST, RSM,}
    \legend{}
  \end{axis}
\end{tikzpicture}
\end{subfigure}
\end{figure}

\end{document}

相关内容