graphics – Same Caption for Two Side-by-Side Figures in Graphics

graphics

I want to place two different figures side by side, but I want the same caption under the figures and not two different ones. I'm using this code:

\begin{figure}[H]
    \centering
    \begin{minipage}{.5\textwidth}
        \centering
        \includegraphics[width=.6\linewidth]{sinexeia}
        \captionof{figure}{Μελέτη του ορίου για ε=0.5 και δ=0.17.}
        \label{fig:test1}
    \end{minipage}%
    \begin{minipage}{.5\textwidth}
        \centering
        \includegraphics[width=.6\linewidth]{n.c.}
        \captionof{figure}{Μελέτη του ορίου για ε=0.5 και δ=0.3.}
        \label{fig:test2}
    \end{minipage}
\end{figure}

Best Answer

It would be simpler to use subfigure environments (provided for example in subcaption) rather than minipage environments. This way, you can choose to add a caption only for the whole figure, for individual subfigures, or for both. In the following example, I added captions for both for the sake of completeness, but you can just remove the \caption commands if you prefer to remove the captions.

\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\begin{subfigure}{.5\textwidth}
    \centering
    \includegraphics[width=.95\linewidth]{example-image-a}
    \caption{Caption for first subfigure}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
    \centering
    \includegraphics[width=.95\linewidth]{example-image-b}
    \caption{Caption for second subfigure}
\end{subfigure}
\caption{Caption for both subfigures as one figure}
\end{figure}
\end{document}