LaTeX forum ⇒ Graphics, Figures & TablesPlacing pgf figures side by side with independent captions Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
bomberb17
Posts: 5
Joined: Sun Feb 10, 2019 8:52 pm

Placing pgf figures side by side with independent captions

Postby bomberb17 » Sun Feb 10, 2019 8:58 pm

Hello, I am trying to place two figures from .pgf file input side-by-side. I want them to have independent captions (so no subfigures). I have tried using the minipage way as follows:

  1. \documentclass{article}
  2. \usepackage{pgf}
  3.  
  4. \begin{document}
  5.  
  6. Some words..
  7. \begin{figure}
  8. \begin{minipage}[t]{0.5\linewidth}
  9. \centering
  10. \input{figure1.pgf}
  11. \label{Figure1}
  12. \caption{This is caption for Figure 1.}
  13. \end{minipage}
  14. \end{figure}
  15. \begin{figure}
  16. \begin{minipage}[t]{0.5\linewidth}
  17. \centering
  18. \input{figure2.pgf}
  19. \label{Figure2}
  20. \caption{This is caption for Figure 2.}
  21. \end{minipage}
  22. \end{figure}
  23.  
  24. \end{document}


But instead of getting them side by side, I get them one below the other... I have tried many different combinations and I can't find a way to make this work... pgf files are here https://a.uguu.se/DPFft8cqVVmz_code.7z if someone needs to test. Thank you

User avatar
Johannes_B
Site Moderator
Posts: 4008
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Feb 10, 2019 9:52 pm

Put both of them inside the same figure environment.
Aside: Make sure to have the label after the caption.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

bomberb17
Posts: 5
Joined: Sun Feb 10, 2019 8:52 pm

Postby bomberb17 » Sun Feb 10, 2019 10:15 pm

That was it! Thank you so much!


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: Baidu [Spider] and 8 guests