0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Latex 図を横に貼る

Posted at

元のスクリプト

\begin{figure}[H]
        \begin{center}
        \resizebox{12cm}{!}{\includegraphics{Figure_1.png}}
        \caption{12/4 LSTM 1時間先 室温予測}\label{picture:lstm_1h_1204}
        \end{center}
\end{figure}
\begin{figure}[H]
        \begin{center}
        \resizebox{12cm}{!}{\includegraphics{Figure_2.png}}
        \caption{12/4 LSTM 2時間先 室温予測}\label{picture:lstm_2h_1204}
        \end{center}
\end{figure}
  • これを横に並べて表示できるようにする

1. subfigureを使用する

\begin{figure}[H]
    \centering
    \begin{subfigure}[b]{0.48\textwidth}
        \centering
        \includegraphics[width=\textwidth]{Figure_1.png}
        \caption{12/4 LSTM 1時間先 室温予測}
        \label{picture:lstm_1h_1204}
    \end{subfigure}
    \hfill
    \begin{subfigure}[b]{0.48\textwidth}
        \centering
        \includegraphics[width=\textwidth]{Figure_2.png}
        \caption{12/4 LSTM 2時間先 室温予測}
        \label{picture:lstm_2h_1204}
    \end{subfigure}
    \caption{LSTM による室温予測結果}
    \label{fig:predictions}
\end{figure}
  • \usepackage{subcaption}が必要
  • Overleafだと何かしらを入れる必要があるかも

2. minipageを使用する

\begin{figure}[H]
    \centering
    \begin{minipage}[b]{0.48\textwidth}
        \centering
        \includegraphics[width=\textwidth]{Figure_1.png}
        \caption{12/4 LSTM 1時間先 室温予測}
        \label{picture:lstm_1h_1204}
    \end{minipage}
    \hfill
    \begin{minipage}[b]{0.48\textwidth}
        \centering
        \includegraphics[width=\textwidth]{Figure_2.png}
        \caption{12/4 LSTM 2時間先 室温予測}
        \label{picture:lstm_2h_1204}
    \end{minipage}
\end{figure}
  • プリアンブル不要
  • 個人的にはこっちの方がオススメ

まとめ

  • latexで図を左右に表示するやり方にはsubfigureを使う方法と、minipageを使う方法がある
  • 後者の方が楽でオススメ
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?