我正在尝试对齐两个子浮点数,以便它们的标题位于同一水平线上。图形本身应该居中。我拥有的代码如下,但我得到的是在附图中。我做错了什么?
\documentclass{scrartcl} % KOMA script (my preference)
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{tikz-rdf}
\usepackage{tikz}
\usepackage{tkz-graph}
\usepackage{tkz-berge}
\usetikzlibrary{shapes,shapes.callouts,,decorations.text,shapes.misc,decorations.pathmorphing,shapes.geometric,backgrounds,fit,positioning,arrows}
\begin{document}
\begin{figure*}[ht!]%
\subfloat[\scriptsize Transaction Database $D$]{
\begin{minipage}[c]{0.3\textwidth}
\centering
\scalebox{.7}{
\begin{tabular}{| p{1cm} | p{1.5cm} | p{4cm} |}\hline
Vertex ID & Entity \mbox{vertex} & Adjacent Attribute Properties \\ \hline \hline
001 & Person1 & salary, gender, title \\ \hline
002 & Person2 & salary, gender, title, nationality \\ \hline
003 & Person3 & salary, gender, title \\ \hline
004 & Person4 & salary, gender, title, nationality \\ \hline
005 & Person5 & salary, gender, nationality \\ \hline
006 & Person6 & salary, title, nationality \\ \hline
007 & Paper1 & year, inProceedings, paperTitle \\ \hline
008 & Paper2 & year, inProceedings, paperTitle \\ \hline
009 & Paper3 & year, inProceedings, paperTitle \\ \hline
010 & School1 & locatedIn, name \\ \hline
011 & School2 & locatedIn, name \\ \hline
012 & School3 & locatedIn, name \\ \hline
\end{tabular}
}
\end{minipage}
\label{fig:db}%
}%
%
\subfloat[\scriptsize T-Index]{
\begin{minipage}[c]{0.7\textwidth}
\centering
\begin{tikzpicture}[node distance=1.5cm, every edge/.style={link}]
%
%Inserting nodes N1-N3
%
\node[circle,draw] (n0){$N_{0}$};
\end{tikzpicture}
\end{minipage}
\label{fig:fp}%
}%
% \vspace{-0.2in}
\caption{T-index}%
\vspace{-0.2in}
\label{fig:star}
\end{figure*}
\end{document}
答案1
好吧,我不确定这是否是实现我想要的最佳方式,但我已经通过使用\raisebox
命令解决了我的问题。以下是我所做的和我得到的结果:
\documentclass{scrartcl} % KOMA script (my preference)
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{tikz-rdf}
\usepackage{tikz}
\usepackage{tkz-graph}
\usepackage{tkz-berge}
\usetikzlibrary{shapes,shapes.callouts,,decorations.text,shapes.misc,decorations.pathmorphing,shapes.geometric,backgrounds,fit,positioning,arrows}
\begin{document}
\begin{figure*}\[ht!\]%
\subfloat\[\scriptsize Transaction Database $D$\]{%
\begin{minipage}\[c\]{0.3\textwidth}
\centering
\scalebox{.7}{
\begin{tabular}{| p{1cm} | p{1.5cm} | p{4cm} |}\hline
Vertex ID & Entity \mbox{vertex} & Adjacent Attribute Properties \\ \hline \hline
001 & Person1 & salary, gender, title \\ \hline
002 & Person2 & salary, gender, title, nationality \\ \hline
003 & Person3 & salary, gender, title \\ \hline
004 & Person4 & salary, gender, title, nationality \\ \hline
005 & Person5 & salary, gender, nationality \\ \hline
006 & Person6 & salary, title, nationality \\ \hline
007 & Paper1 & year, inProceedings, paperTitle \\ \hline
008 & Paper2 & year, inProceedings, paperTitle \\ \hline
009 & Paper3 & year, inProceedings, paperTitle \\ \hline
010 & School1 & locatedIn, name \\ \hline
011 & School2 & locatedIn, name \\ \hline
012 & School3 & locatedIn, name \\ \hline
\end{tabular}
}
\end{minipage}
\label{fig:db}%
}%
%
\subfloat\[\scriptsize T-Index\]{%
\begin{minipage}\[c\]{0.7\textwidth}
\centering
\raisebox{10em}\[18em\]{
\scalebox{.5}{
\begin{tikzpicture}\[node distance=1.5cm, every edge/.style={link}\]
%
%Inserting nodes N1-N3
%
\node\[circle,draw\] (n0){$N_{0}$};
\end{tikzpicture}
}}
\end{minipage}
\label{fig:fp}%
}%
% \vspace{-0.2in}
\caption{T-index}%
\vspace{-0.2in}
\label{fig:star}
\end{figure*}
\end{document}]