Gostaria de saber se é possível organizar gráficos de látex em uma grade.
Eu sei que é possível organizar gráficos usando o pacote 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}
No entanto, meus gráficos estão no formato de
\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}
Tentei substituir \includegraphics[]{}
pelo código do gráfico, porém não funcionou
Existe alguma maneira de inserir um gráfico tikzpicture como uma grade de sublegenda?
Responder1
Ok, consegui funcionar. Se alguém tiver o mesmo problema, aqui está o formato que usei
\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}