logo

LaTeX에서 서브플랏 그리는 법 📂논문작성

LaTeX에서 서브플랏 그리는 법

설명

\includegraphics[width=0.5\textwidth]{WJSN_Luda.jpg}
\includegraphics[width=0.5\textwidth]{WJSN_Yeoreum.jpg} \\
\includegraphics[width=\textwidth]{IVE_Rei.jpg}

사진을 한 줄에 여러장 배치하는 건 사실 그냥 위와 같이 크기만 조절해도 된다.

3509_image1.png

각 서브플랏에 캡션을 달고 이들을 하나의 Figure로 묶어 넘버링을 하는 등의 조작하려면 subfig패키지를 사용하면 된다.

  • \subfloat[caption]{figure}

\subplot이 아님에 주의하자.

begin{figure}[h]
\subfloat[우주소녀 루다]{\includegraphics[width=0.5\textwidth]{WJSN_Luda.jpg}}
\subfloat[우주소녀 여름]{\includegraphics[width=0.5\textwidth]{WJSN_Yeoreum.jpg}} \\
\subfloat[아이브 장원영]{\includegraphics[width=0.5\textwidth]{IVE_Wonyoung.jpg}}
\subfloat[아이브 레이]{\includegraphics[width=0.5\textwidth]{IVE_Rei.jpg}} \\
\subfloat[이달의소녀 희진]{\includegraphics[width=0.5\textwidth]{LOONA_Heejin.jpg}}
\subfloat[에스파 윈터]{\includegraphics[width=0.5\textwidth]{aespa_Winter.jpg}}
\caption{썸네일}
\label{fig: thumbnail}
\end{figure}

3509_image3.png

코드 전문

\documentclass{article}
\usepackage{graphicx} % 이미지 삽입.
\usepackage{kotex} % 한글 사용.
\usepackage{subfig} % subfloat

\begin{document}

\section{How to plot subplots in \LaTeX?}

\begin{figure}[h]
\subfloat[우주소녀 루다]{\includegraphics[width=0.5\textwidth]{WJSN_Luda.jpg}}
\subfloat[우주소녀 여름]{\includegraphics[width=0.5\textwidth]{WJSN_Yeoreum.jpg}} \\
\subfloat[아이브 장원영]{\includegraphics[width=0.5\textwidth]{IVE_Wonyoung.jpg}}
\subfloat[아이브 레이]{\includegraphics[width=0.5\textwidth]{IVE_Rei.jpg}} \\
\subfloat[이달의소녀 희진]{\includegraphics[width=0.5\textwidth]{LOONA_Heejin.jpg}}
\subfloat[에스파 윈터]{\includegraphics[width=0.5\textwidth]{aespa_Winter.jpg}}
\caption{썸네일}
\label{fig: thumbnail}
\end{figure}

\end{document}