Unterfiguren in der Unterfigurenmatrix

Unterfiguren in der Unterfigurenmatrix

Ich möchte 5 Unterbilder platzieren, 3 in der ersten Reihe, zwei in der zweiten. Die letzten beiden müssen die gleichen Abmessungen wie die ersten drei haben, aber zentriert sein (ich meine beide in der Nähe der Seitenmitte, nicht an den Enden).

\begin{figure}[H]

\begin{subfigmatrix}{3}
    \subfigure[$\mathbb{P}^2$]{\includegraphics{Chapter3/Immagini/RSB/p2.png}}
    \subfigure[$\mathbb{P}^4$]{\includegraphics{Chapter3/Immagini/RSB/p4.png}}
    \subfigure[$\mathbb{P}^6$]{\includegraphics{Chapter3/Immagini/RSB/p6.png}}
    \subfigure[$\mathbb{P}^8$]{\includegraphics{Chapter3/Immagini/RSB/p8.png}}
    \subfigure[$\mathbb{P}^{10}$]{\includegraphics{Chapter3/Immagini/RSB/p10.png}}
\end{subfigmatrix}
\caption{RSB -- $\theta'$ contours , $\mathbb{P}^{2,4,6,8,10}$ solutions on a mesh of $2\,400$ elements using the Godunov flux.}
\label{fig:rsb}

\end{figure}

Antwort1

Meine Idee ist geklaut vonHier. Scheint so, als subfigmatrixwürde es verwendet \hfill, um den Abstand zwischen den Unterfiguren einzustellen. Hier ändern wir lokal \hfillzu \hspace{0.1cm}, sodass Sie immer 0,1 cm Abstand zwischen Ihren Unterfiguren haben.

\documentclass{article}
\usepackage{graphicx,subfigmat,etoolbox,amssymb,float}
\begin{document}
\begin{figure}[H]
\patchcmd{\subfigmatrix}{\hfill}{\hspace{0.2cm}}{}{}
\begin{subfigmatrix}{3}
    \subfigure[$\mathbb{P}^2$]{\includegraphics{example-image}}
    \subfigure[$\mathbb{P}^4$]{\includegraphics{example-image}}
    \subfigure[$\mathbb{P}^6$]{\includegraphics{example-image}}
    \subfigure[$\mathbb{P}^8$]{\includegraphics{example-image}}
    \subfigure[$\mathbb{P}^{10}$]{\includegraphics{example-image}}
\end{subfigmatrix}
\caption{RSB -- $\theta'$ contours , $\mathbb{P}^{2,4,6,8,10}$ solutions on a mesh of $2\,400$ elements using the Godunov flux.}
\label{fig:rsb}
\end{figure}
\end{document}

Ergebnis


Eine andere Idee

Um Ihnen noch eine Idee zu geben: Sie können subcaptionFolgendes versuchen \subcaptionbox:

\documentclass{article}
\usepackage{graphicx,subcaption,amssymb}
\begin{document}
\begin{figure}
    \centering
    \subcaptionbox{$\mathbb{P}^2$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
    \subcaptionbox{$\mathbb{P}^4$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
    \subcaptionbox{$\mathbb{P}^6$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
    \subcaptionbox{$\mathbb{P}^8$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
    \subcaptionbox{$\mathbb{P}^{10}$}[0.3\linewidth]{\includegraphics[width=\linewidth]{example-image}}
\caption{RSB -- $\theta'$ contours , $\mathbb{P}^{2,4,6,8,10}$ solutions on a mesh of $2\,400$ elements using the Godunov flux.}
\label{fig:rsb}
\end{figure}
\end{document}

Ergebnis (Untertitelbox)

Antwort2

Das subfigmatPaket verwendet subfiguredieses seit etwa 20 Jahren und ist veraltet.

Hier ist ein ähnlicher Ansatz mit subfig. Ein Trick ist erforderlich, da \subfloatLeerzeichen danach ignoriert werden.

\documentclass{article}
\usepackage{graphicx,amssymb,subfig}
\usepackage{showframe}

\NewCommandCopy\ORIsubfloat\subfloat
\NewDocumentCommand{\NEWsubfloat}{om}{%
  \begingroup\setlength{\spaceskip}{0pt}%
  \IfValueTF{#1}{\ORIsubfloat[#1]{#2}}{\ORIsubfloat{#2}}%
  \endgroup\space\ignorespaces
}

\newlength{\subfloatmatrixwidth}
\newenvironment{subfloatmatrix}[2][0.2cm]{%
  \centering
  \setlength{\subfloatmatrixwidth}{%
    \dimexpr(\columnwidth-(#1)*\numexpr(#2-1)\relax)/(#2)\relax
  }%
  \setlength{\spaceskip}{#1 minus 1pt}%
  \setkeys{Gin}{width=\subfloatmatrixwidth}%
  \setlength{\lineskip}{\medskipamount}%
  \RenewCommandCopy\subfloat\NEWsubfloat
}{\par}

\begin{document}

\begin{figure}[htp]
\begin{subfloatmatrix}{3}
    \subfloat[$\mathbb{P}^2$]{\includegraphics{example-image}}
    \subfloat[$\mathbb{P}^4$]{\includegraphics{example-image}}
    \subfloat[$\mathbb{P}^6$]{\includegraphics{example-image}} 
    \subfloat[$\mathbb{P}^8$]{\includegraphics{example-image}}
    \subfloat[$\mathbb{P}^{10}$]{\includegraphics{example-image}}
\end{subfloatmatrix}
\caption{RSB -- $\theta'$ contours , $\mathbb{P}^{2,4,6,8,10}$ solutions on 
  a mesh of $2\,400$ elements using the Godunov flux.}
\label{fig:rsb}
\end{figure}

\end{document}

Die Umgebung verfügt auch über ein optionales Argument für den Abstand zwischen Unterschwimmern, standardmäßig 0,2 cm.

Bildbeschreibung hier eingeben

Das Gleiche, aber mit

\begin{subfloatmatrix}[0.5cm]{3}

Bildbeschreibung hier eingeben

verwandte Informationen