1
\begin{figure}[H]
\centering
\begin{subfigure}[]
    \centering
    \includegraphics[width=7.5cm, height = 6 cm]{figures/insercaoPellets1.pdf}
\end{subfigure}%
\begin{subfigure}[]
    \centering
    \includegraphics[width=7.5cm, height = 6 cm]{figures/insercaoPellets2.pdf}
\end{subfigure}
\begin{subfigure}[]
    \centering
    \includegraphics[width=7.5cm, height = 6 cm]{figures/insercaoPellets3.pdf}
\end{subfigure}%
\begin{subfigure}[]
    \centering
    \includegraphics[width=7.5cm, height = 6 cm]{figures/insercaoPellets4.pdf}
\end{subfigure}
\caption{Possible process of formation of the plug: (a) Bentonite pellets are dropped down within the wellbore. (b) Due to the humidity present in the ambient, the pellets begin to swell during the fall. (c) When the pellets are already inside the bore's water, fragments of bentonite tend to attach to the pipe due do the adhesion force between the moist bentonite and the solid walls. (d) Presence of a seal made out of bentonite due to several particles bond to each other, forming a plug.}
\label{fig:formacaoPlug}

\end{figure}

Hello to everyone.

I am working on a document where I need to use a figure with multiple subfigures. The figures are well centered, as you can see here

enter image description here.

However, as you can also see, the letter corresponding to each figure is NOT centered. Instead, they are left-aligned. I did find something about the width of the figures. Basically, all the figures of my document have the same warning message. Specifically to the attached figure, the warning error is:

enter image description here.

Does anyone know a way to fix this problem?

Thank you!

2 Answers 2

1

This should point you in the right direction for the case of two side-by-side sub-figures. Fiddling with absolute widths (and possibly heights) of the graphs is unproductive. Instead, specify the relative widths, say, as a percentage of the overall width of the text block.

enter image description here

MWE

\documentclass{article}
% In preamble:
\usepackage[demo]{graphicx} % remove 'demo' option in real document
\usepackage{caption}
\usepackage{subcaption}

\begin{document}
% In document:
\begin{figure}
    \begin{subfigure}{0.45\textwidth}
        \includegraphics[width=\textwidth]{img_a}
        \caption{img\_A}
        \label{fig:my-figureA}
    \end{subfigure}%
    \hfill %% maximize separation of the 'subfigure' environments
    \begin{subfigure}{0.45\textwidth}
        \includegraphics[width=\textwidth]{img_b}
        \caption{img\_B}
        \label{fig:my-figureB}
    \end{subfigure}

    \caption{A caption.}
    \label{fig:my-figure}
\end{figure}
\end{document}
1
  • 1
    +1. I've taken the liberty of editing the code a bit.
    – Mico
    Apr 23, 2020 at 5:31
0

First of all, thank you for answering!

I tried to use your code, js bibra. However, instead of obtaining a letter to the figure, it had a new name (Figure 1.3), as can be seen here enter image description here.

Besides, it is much bigger than the size it really should be, and the 0.45 value appears on the left and right bottom of the image. Here is the code I used:

\begin{figure}
\begin{subfigure}{0.45\textwidth}
    \includegraphics[width=\textwidth]{figures/insercaoPellets1.pdf}
    \caption{FIGURE A}
    \label{fig:my-figureA}
\end{subfigure}%
\hfill %% maximize separation of the 'subfigure' environments
\begin{subfigure}{0.45\textwidth}
    \includegraphics[width=\textwidth]{figures/insercaoPellets2.pdf}
    \caption{FIGURE B}
    \label{fig:my-figureB}
\end{subfigure}
\hfill %% maximize separation of the 'subfigure' environments
\begin{subfigure}{0.45\textwidth}
    \includegraphics[width=\textwidth]{figures/insercaoPellets3.pdf}
    \caption{FIGURE C}
    \label{fig:my-figureC}
\end{subfigure}\hfill %% maximize separation of the 'subfigure' environments
\begin{subfigure}{0.45\textwidth}
    \includegraphics[width=\textwidth]{figures/insercaoPellets4.pdf}
    \caption{FIGURE D}
    \label{fig:my-figureD}
\end{subfigure}

\caption{TEST}
\label{fig:my-figure}

\end{figure}

PS: Mico, I can not see your answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .