TransWikia.com

Inserting horizontal space between two images in the `figure` environment

TeX - LaTeX Asked by smilingbuddha on December 6, 2020

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}

One Answer

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}

Correct answer by js bibra on December 6, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP