라텍스 그래프를 그리드로 배열하는 것이 가능한지 궁금합니다.
하위 캡션 패키지를 사용하여 그래픽을 정렬하는 것이 가능하다는 것을 알고 있습니다.
\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}