Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading