2

I am trying to align two subfloats so that their captions are on the same horizontal line. The figures themselves should be centered. The code I have is the following, but what I am getting is in the attached figure. What am I doing wrong?

\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}  

enter image description here

10
  • 2
    Minimal Working Examples should really be a little more minimal.
    – qubyte
    Commented Mar 7, 2012 at 13:14
  • Unfortunately, this is as minimal as I can get with my example to demonstrate that the captions do not line up. If you can help, that would be appreciated.
    – ozsu
    Commented Mar 7, 2012 at 13:18
  • Try using the graphicx package with the demo option. You're asking about aligning sub-figures, and that doesn't need TikZ to demonstrate. meta.tex.stackexchange.com/q/228/9043
    – qubyte
    Commented Mar 7, 2012 at 13:21
  • Alternatively two TikZ rectangles, one in each sub-figure would also work.
    – qubyte
    Commented Mar 7, 2012 at 13:23
  • OK, I have minimized the example to keep one table on the left and one tikz circle on the right.
    – ozsu
    Commented Mar 7, 2012 at 13:41

1 Answer 1

1

Well, I am not sure if it is the best way to achieve what I want, but I have solved my problem by using \raisebox command. Here is what I did and what I get:

\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}]

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .