Minipage Tabelle und Bild verschoben

Tabellen und Grafiken erstellen und anordnen


Raumi

Minipage Tabelle und Bild verschoben

Beitrag von Raumi »

Hallo liebe LATEX-Gemeinde,

ich versuche über Mnipage ein Bild und eine Tabelle einzufügen. Bisher hat das auch immer super geklappt, aber im nachfolgenden Beispiel sind die beiden in der Höhe gegeneinander verschoben. Kann mir eventuell jemand bitte helfen?
\begin{figure}[htbp] 
\begin{minipage}[t]{0.33\textwidth} 
\centering 
\includegraphics[width=1.0\textwidth]{charateristic_length_over_time.png} 
\caption{Characteristic length for spherical, ellipsoidal and inverse-oblate geometries} 
\label{fig:charateristic_length} 
\end{minipage} 
\begin{minipage}[t]{0.66\textwidth} 
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
& \textbf{$t \left[ h \right]$} & \textbf{$L_{ch} \left[ mm \right]$}                                      & \textbf{$A \left[ mm^2 \right]$} & \textbf{$V \left[ mm^3 \right]$} \\ \hline
\multirow{3}{*}{\textbf{Sphere}}                      & 0                     & 9.09                                                          & 260.65                                    & 391.97                                      \\ \cline{2-5} 
                                                      & 20                    & 8.46                                                          & 235.24                                    & 316.62                                      \\ \cline{2-5} 
                                                      & 40                    & 7.75                                                          & 207.95                                    & 246.02                                      \\ \hline
\multirow{3}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Inverse-oblate \\ (vertical)\end{tabular}}}   & 0                     & 17.79                                                         & 548.51                                    & 817.09                                      \\ \cline{2-5} 
                                                      & 20                    & 16.28                                                         & 469.18                                    & 650.60                                      \\ \cline{2-5} 
                                                      & 40                    & 15.62                                                         & 409.61                                    & 517.03                                      \\ \hline
\multirow{11}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Inverse-oblate \\ (horizontal)\end{tabular}}} & \multirow{3}{*}{0}    & \begin{tabular}[c]{@{}c@{}}9.14 \\ (without Pin)\end{tabular} & \multirow{3}{*}{506.10}                   & \multirow{3}{*}{805.44}                     \\ \cline{3-3}
                                                      &                       & \begin{tabular}[c]{@{}c@{}}9.20\\ (with Pin)\end{tabular}     &                                           &                                             \\ \cline{2-5} 
                                                      & \multirow{3}{*}{20}   & \begin{tabular}[c]{@{}c@{}}8.67\\ (without Pin)\end{tabular}  & \multirow{3}{*}{475.84}                   & \multirow{3}{*}{689.76}                     \\ \cline{3-3}
                                                      &                       & \begin{tabular}[c]{@{}c@{}}8.72\\ (with Pin)\end{tabular}     &                                           &                                             \\ \cline{2-5} 
                                                      & \multirow{3}{*}{40}   & \begin{tabular}[c]{@{}c@{}}8.18\\ (without Pin)\end{tabular}  & \multirow{3}{*}{452.59}                   & \multirow{3}{*}{581.88}                     \\ \cline{3-3}
                                                      &                       & \begin{tabular}[c]{@{}c@{}}8.23\\ (with Pin)\end{tabular}     &                                           &                                             \\ \hline
\end{tabular}
\caption{My caption}
\label{my-label}
\end{minipage} 
\end{figure} 
Besten Dank im Voraus!

Bartman
Forum-Meister
Forum-Meister
Beiträge: 2456
Registriert: Do 16. Jul 2009, 21:41
Wohnort: Hessische Provinz

Beitrag von Bartman »

Dein Beispiel ist unvollständig.

Benutze besser den Befehl \captionof, damit die Beschriftung zur Tabelle passt.

Außerdem solltest Du Dir die Fähigkeiten des Pakets siunitx ansehen.

Die Anwendung des Pakets booktabs ist ebenfalls zu empfehlen, auch wenn das in diesem Fall nicht so einfach sein dürfte.
\documentclass{scrartcl}
\usepackage[demo]{graphicx}
\usepackage{multirow}
\usepackage{showframe}

\begin{document}
\begin{figure}[htbp]
\begin{minipage}{0.33\textwidth}
\centering
\includegraphics[width=\textwidth]{charateristic_length_over_time.png}
\caption{Characteristic length for spherical, ellipsoidal and inverse-oblate geometries}
\label{fig:charateristic_length}
\end{minipage}%
\hfill
\begin{minipage}{0.66\textwidth}
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
& \textbf{$t \left[ h \right]$} & \textbf{$L_{ch} \left[ mm \right]$}                                      & \textbf{$A \left[ mm^2 \right]$} & \textbf{$V \left[ mm^3 \right]$} \\ \hline
\multirow{3}{*}{\textbf{Sphere}}                      & 0                     & 9.09                                                          & 260.65                                    & 391.97                                      \\ \cline{2-5}
                                                      & 20                    & 8.46                                                          & 235.24                                    & 316.62                                      \\ \cline{2-5}
                                                      & 40                    & 7.75                                                          & 207.95                                    & 246.02                                      \\ \hline
\multirow{3}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Inverse-oblate \\ (vertical)\end{tabular}}}   & 0                     & 17.79                                                         & 548.51                                    & 817.09                                      \\ \cline{2-5}
                                                      & 20                    & 16.28                                                         & 469.18                                    & 650.60                                      \\ \cline{2-5}
                                                      & 40                    & 15.62                                                         & 409.61                                    & 517.03                                      \\ \hline
\multirow{11}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Inverse-oblate \\ (horizontal)\end{tabular}}} & \multirow{3}{*}{0}    & \begin{tabular}[c]{@{}c@{}}9.14 \\ (without Pin)\end{tabular} & \multirow{3}{*}{506.10}                   & \multirow{3}{*}{805.44}                     \\ \cline{3-3}
                                                      &                       & \begin{tabular}[c]{@{}c@{}}9.20\\ (with Pin)\end{tabular}     &                                           &                                             \\ \cline{2-5}
                                                      & \multirow{3}{*}{20}   & \begin{tabular}[c]{@{}c@{}}8.67\\ (without Pin)\end{tabular}  & \multirow{3}{*}{475.84}                   & \multirow{3}{*}{689.76}                     \\ \cline{3-3}
                                                      &                       & \begin{tabular}[c]{@{}c@{}}8.72\\ (with Pin)\end{tabular}     &                                           &                                             \\ \cline{2-5}
                                                      & \multirow{3}{*}{40}   & \begin{tabular}[c]{@{}c@{}}8.18\\ (without Pin)\end{tabular}  & \multirow{3}{*}{452.59}                   & \multirow{3}{*}{581.88}                     \\ \cline{3-3}
                                                      &                       & \begin{tabular}[c]{@{}c@{}}8.23\\ (with Pin)\end{tabular}     &                                           &                                             \\ \hline
\end{tabular}
\captionof{table}{My caption}
\label{tab:my-label}
\end{minipage}
\end{figure}
\end{document}
Zuletzt geändert von Bartman am Mo 1. Apr 2019, 17:25, insgesamt 2-mal geändert.

Raumi

Beitrag von Raumi »

Wow, vielen Dank für die schnelle Antwort und die super Hilfe! Das sieht doch gut aus und funktioniert!

Dankeschön!

Bartman
Forum-Meister
Forum-Meister
Beiträge: 2456
Registriert: Do 16. Jul 2009, 21:41
Wohnort: Hessische Provinz

Beitrag von Bartman »

Da die Beschriftung der Abbildung wenig Platz zur Fügung hat, wäre es überlegenswert, deren Text linksbündig auszurichten. Im Fall einer KOMA-Script-Klasse könntest Du dafür den Befehl \setcaptionalignment lokal in der minipage-Umgebung der Abbildung einsetzen.

Bezogen auf die Optionen Deiner minipages hättest Du am Anfang beider Umgebungen noch \vspace{0pt} einfügen müssen.

Der Zustand des Themas darf dann wohl angepasst werden.

Antworten