0

I tried to crop the blank space above and below the image with \includegraphics[trim=left bottom right top, clip]. It worked very well at the bottom, however at the top it cuts the title (caption). How can I crop the blank space between the title and the image?

\begin{figure}[b]
    \centering
    \caption{Disaster events in the period 2005-2008}
    \includegraphics[trim =0cm 2.5cm 0cm 0.4cm clip, width=\textwidth]{XXX.pdf}
   \caption*{\footnotesize{\textbf{Notes:} XXX}.}
    \label{XXX}
\end{figure}

enter image description here

1 Answer 1

2

I downloaded the full figure following your code and applied trim and clip to eliminate all text and space around the center map.

I also removed the unneeded \caption*. (In your code a comma is missing before clip)

\documentclass[12pt,a4paper]{article}

\usepackage{graphicx}

\begin{document}
    \begin{figure}
        \centering
        \caption{Disaster events in the period 2005-2008}
        \includegraphics[trim =4cm 4.5cm 4cm 6cm, clip, width=\textwidth]{9Q2tV.png}
        {\footnotesize\textbf{Notes:} XXX.} % changed <<<<<<<<<<
        \label{XXX}
    \end{figure}

    \begin{figure}
    \centering
    \caption{Disaster events in the period 2005-2008}
    \includegraphics[trim =3cm 3cm 3cm 3cm, clip, width=\textwidth]{example-image.pdf}
    {\footnotesize\textbf{Notes:} XXX.} % changed <<<<<<<<<<
    \label{XXX}
\end{figure}

\end{document}

a

It also works with the test image example-image.pdf provided by graphicx.

b

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.