我想知道是否可以將乳膠圖排列成網格。
我知道可以使用 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}