![サブインポートを使用して隣り合うサブ図](https://rvso.com/image/400371/%E3%82%B5%E3%83%96%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E9%9A%A3%E3%82%8A%E5%90%88%E3%81%86%E3%82%B5%E3%83%96%E5%9B%B3.png)
2 つのサブ図を並べて表示したい (1 つは左、もう 1 つは右)。問題は、常にサブ図が上下に表示されることです。また、includefigure ではなく、subimport 機能を使用したいのですが、残念ながら、オンラインで見つけた例はすべて includefigure のみを使用しています。
scalebox も試してみましたが、うまくいきませんでした。プロットは依然として隣り合って配置されておらず、軸ラベルも拡大縮小されてしまいますが、これは望ましくありません。画像は隣り合って配置できるほど細くする必要があります。
これをサブインポートで動作させるにはどうすればよいですか?
次のコードを試しました:
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{import}
\usepackage{pgfplots}
\begin{document}
\begin{figure}[ht]
\centering
\begin{subfigure}[b]{0.5\textwidth}
\subimport*{plots/somePath/}{plot1.tex}
\caption{sub caption 1}
\end{subfigure}
\begin{subfigure}[b]{0.5\textwidth}
\subimport*{plots/somePath/}{plot2.tex}
\caption{sub caption 2}
\end{subfigure}
\caption{test.}
\end{figure}
\end{document}
これは、テスト用の両方のサブプロットに使用できるプロットの tikz コードです。
\begin{tikzpicture}
\begin{axis}[%
width=1.5in,
height=1in,
at={(0in,0in)},
scale only axis,
xmin=0,
xmax=5,
ymin=0,
ymax=10,
axis background/.style={fill=white}
]
\addplot [color=blue,solid,forget plot]
table[row sep=crcr]{%
0 0\\
0.555555555555556 1.11111111111111\\
1.11111111111111 2.22222222222222\\
1.66666666666667 3.33333333333333\\
2.22222222222222 4.44444444444444\\
2.77777777777778 5.55555555555556\\
3.33333333333333 6.66666666666667\\
3.88888888888889 7.77777777777778\\
4.44444444444444 8.88888888888889\\
5 10\\
};
\end{axis}
\end{tikzpicture}