Subfloat caption adjustment does not work

subcaptionsubfloats

I want to remove the extra margin in front of the second subcaption (the yellow part).
How can I achieve this?

enter image description here

My current code is as follows.

\documentclass[a4paper,11pt]{report}
\usepackage{import}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{caption}

\newcommand\mycaption[2]{\caption{\textbf{#1}\newline\footnotesize#2}}
\captionsetup{font=small, labelfont=bf, singlelinecheck=false, tableposition=bottom, justification=justified}
\begin{document}

% test 
\begin{figure}[h]
\captionsetup[subfloat]{farskip=1pt, captionskip=0pt} %<--I thought it does the job...
\centering
\captionsetup{width=0.7\linewidth}
\subfloat[First figure]
{%
    \label{fig1}%
    \includegraphics[clip,width=0.85\columnwidth]{myfig1.png} }
    \vfill 
\subfloat[Second figure]
{%
    \label{fig2}%
    \includegraphics[clip,width=0.85\columnwidth]{myfig2.png} }
\mycaption{Test}{Explanation blah blah...}
\label{figExamples}
\end{figure}

\end{document}

NOTE

It might be figure specific issue, so I am attaching two images here for your advice.

enter image description here
enter image description here

Best Answer

The second figure has some blank space underneath.

Use trim={<left> <lower> <right> <upper>}

a

\documentclass[a4paper,11pt]{report}
\usepackage{import}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{caption}

\newcommand\mycaption[2]{\caption{\textbf{#1}\newline\footnotesize#2}}
\captionsetup{font=small, labelfont=bf, singlelinecheck=false, tableposition=bottom, justification=justified}
\begin{document}
    
    % test 
    \begin{figure}[h]
        \captionsetup[subfloat]{farskip=1pt, captionskip=0pt} %<--I thought it does the job...
        \centering
        \captionsetup{width=0.7\linewidth}
        \subfloat[First figure]
        {%
            \label{fig1}%
            \includegraphics[clip,width=0.85\columnwidth]{myfig1.png} } 
        \vfill 
        \subfloat[Second figure]
        {%
            \label{fig2}%
            \includegraphics[trim={ 0pt 25pt 0pt 0pt}, clip,width=0.85\columnwidth]{myfig2.png} }% changed <<<<<<
        \mycaption{Test}{Explanation blah blah...}
        \label{figExamples}
    \end{figure}

\end{document}
Related Question