latexresizefiguresubfigure

change subfigure configuration in latex


I use the following example code to create a subfigure in my latex document.

\usepackage{caption}
\usepackage{subcaption}

\begin{figure}
 \centering
 \begin{subfigure}[b]{0.3\textwidth}
     \centering
     \includegraphics[width=\textwidth]{Figures/F1.png}
     \caption{}
     \label{fig:1}
 \end{subfigure}
 \hfill
 \begin{subfigure}[b]{0.3\textwidth}
     \centering
     \includegraphics[width=\textwidth]{Figures/F2.png}
     \caption{}
     \label{fig:2}
 \end{subfigure}
 \hfill
 \begin{subfigure}[b]{0.3\textwidth}
     \centering
     \includegraphics[width=\textwidth]{Figures/F3.png}
     \caption{}
     \label{fig:3}
 \end{subfigure}
    \caption{Values}
    \label{fig:three graphs}
\end{figure}

And I get the following output configuration enter image description here

But the sub-figures are too small on the page. So I want to change it to the following configuration and make the figure a bit larger and centered. How to modify this code to change the Figure configuration? enter image description here


Solution

  • \documentclass{article}
    
    \usepackage{caption}
    \usepackage{subcaption}
    \usepackage{graphicx}
    
    \begin{document}
    
    \begin{figure}
     \centering
     \begin{subfigure}[b]{0.45\textwidth}
         \centering
         \includegraphics[width=\textwidth]{example-image-duck}
         \caption{}
         \label{fig:1}
     \end{subfigure}
     \quad
     \begin{subfigure}[b]{0.45\textwidth}
         \centering
         \includegraphics[width=\textwidth]{example-image-duck}
         \caption{}
         \label{fig:2}
     \end{subfigure}
     
     \begin{subfigure}[b]{0.45\textwidth}
         \centering
         \includegraphics[width=\textwidth]{example-image-duck}
         \caption{}
         \label{fig:3}
     \end{subfigure}
        \caption{Values}
        \label{fig:three graphs}
    \end{figure}
    \end{document}
    

    enter image description here