1

I want to place three figures next to each other, as indicated in the code below. But the resulting image has all three figures packed very closely to one another. I'd like to have some horizontal separation between the images. How do I modify the code below to achieve that?

\begin{figure}[ht]
  \centering
  \includegraphics[width=5cm]{./miscimages/1nng-example.png}
  \includegraphics[width=5m]{./miscimages/2nng-example.png}
  \includegraphics[width=5cm]{./miscimages/3nng-example.png}
  \caption{\label{fig:knng} Generating some graphs}
\end{figure}
  • use \hspace between the images -the second image is it 5metre -- also see https://tex.stackexchange.com/questions/74353/what-commands-are-there-for-horizontal-spacing – js bibra Oct 19 '20 at 16:20
  • Insert \hfil between\includegraphicx[...]{...}. – Zarko Oct 19 '20 at 16:29

1 Answers1

2

enter image description here

    \begin{figure}[ht]
    \centering
    \includegraphics[width=5cm]{./miscimages/1nng-example.png}\hfill
    \includegraphics[width=5mm]{./miscimages/2nng-example.png}\hfill
    \includegraphics[width=5cm]{./miscimages/3nng-example.png}
    \caption{\label{fig:knng} Generating some graphs}
\end{figure}

enter image description here

\begin{figure}[ht]
    \centering
    \includegraphics[width=5cm]{./miscimages/1nng-example.png}\hspace{4ex}
    \includegraphics[width=5mm]{./miscimages/2nng-example.png}\hspace{4ex}
    \includegraphics[width=5cm]{./miscimages/3nng-example.png}
    \caption{\label{fig:knng} Generating some graphs}
\end{figure}
js bibra
  • 21,280