子图中的垂直对齐

子图中的垂直对齐

我对子图中 3 个元素的垂直对齐存在问题:这 3 个项目是:由“tikzpicture”制作的图形、由“tabular”制作的表格和普通静态图像。以下是代码:

\begin{figure}[htbp]
\centering%
\subfigure[Coordinate]{
{\begin{tikzpicture}
\begin{axis}[
width=7cm,height=7cm,
xmin=-1,xmax=13,
ymin=-1,ymax=13,
ytick = {0,1,2,...,12},
xtick = {0,1,2,...,12},
grid=major]
\addplot[mark=*,only marks, color=blue, line width=4pt] file {grafici/Coordinate.txt};
\addplot [mark=*,only marks, color=red, line width=7pt]  coordinates {(1, 0)};
\end{axis}
\end{tikzpicture}
}
\label{fig:conclusione1}}
\subfigure[Distanze]{
{\begin{tabular}{|cc|}
\hline
Coordinata & Distanza \\ \hline
(0,0) & 1,00 \\ 
(2,0) & 1,00 \\
(1,2) & 2,00 \\
(9,0) & 8,00 \\
(10,0) & 9,00 \\
(10,1) & 9,05 \\
(10,2) & 9,21 \\
(0,10) & 10,05 \\
(1,10) & 10,00 \\
(0,12) & 12,04 \\
(2,12) & 12,04 \\
(11,9) & 13,45 \\
(12,8) & 13,60 \\
(11,12) & 15,62 \\
(12,12) & 16,28 \\  \hline
\end{tabular}}
\label{fig:conclusione2}}
\subfigure[Vicinato]{
\includegraphics [width=12cm] {img/view_rosso.jpg}
\label{fig:conclusione3}}
\caption{Conclusioni - esempio dei punti cardinali}
\label{fig:conclusioni}
\end{figure}![Image][1]

我会将图 a 与图 b 垂直对齐

非常感谢大家!

结果

答案1

我使用subcaption包语法来与标题对齐

\documentclass[]{article}
\usepackage{pgfplots,subcaption}

\begin{document}

\begin{figure}
\begin{subfigure}[b]{0.5\textwidth}\centering
\begin{tikzpicture}
\begin{axis}[
width=7cm,height=7cm,
xmin=-1,xmax=13,
ymin=-1,ymax=13,
ytick = {0,1,2,...,12},
xtick = {0,1,2,...,12},
grid=major]
\addplot[mark=*,only marks, color=blue, line width=4pt] {15*sin(deg(x))};
\addplot [mark=*,only marks, color=red, line width=7pt]  coordinates {(1, 0)};
\end{axis}
\end{tikzpicture}
\label{fig:conclusione1}
\caption{Coordinate}
\end{subfigure}
\begin{subtable}[b]{0.5\textwidth}\centering
\begin{tabular}{|cc|}
\hline
Coordinata & Distanza \\ \hline
(0,0) & 1,00 \\ 
(2,0) & 1,00 \\
(1,2) & 2,00 \\
(9,0) & 8,00 \\
(10,0) & 9,00 \\
(10,1) & 9,05 \\
(10,2) & 9,21 \\
(0,10) & 10,05 \\
(1,10) & 10,00 \\
(0,12) & 12,04 \\
(2,12) & 12,04 \\
(11,9) & 13,45 \\
(12,8) & 13,60 \\
(11,12) & 15,62 \\
(12,12) & 16,28 \\  \hline
\end{tabular}
\caption{Distanze}
\label{fig:conclusione2}
\end{subtable}
\begin{subfigure}{\textwidth}\centering
\includegraphics [width=12cm,height=2cm] {example-image}
\caption{Vicinato}
\label{fig:conclusione3}
\end{subfigure}
\caption{Conclusioni - esempio dei punti cardinali}
\label{fig:conclusioni}
\end{figure}
\end{document}

在此处输入图片描述

相关内容