Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Figure 1

Can I make the figure which I just posted here in LaTeX?

share|improve this question
1  
Yes,for sure you can. Read about tikz. For example texample.net/tikz/examples/tex-workflow –  Sigur Oct 7 '13 at 13:08
1  
Have a look at the tikz-cd package; it seems suitable for your purpose –  Kevin C Oct 7 '13 at 13:32
    
I'd use TikZ-matrices to place nodes for this. –  Claudio Fiandrino Oct 7 '13 at 13:58

2 Answers 2

up vote 6 down vote accepted

Making use of Claudio Fiandrino's suggestion to use a matrix to typeset the diagrams as well as the subcaption package and some minipages, here's a way to implement the figure that you have in mind. Note the required %s in order to make sure that the first two minipages appear next to each other rather than on top of each other.

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{matrix}
\usepackage{subcaption}

\begin{document}

\begin{figure}
\centering

    \begin{minipage}[b]{.4\linewidth}
    \centering

        \begin{tikzpicture}

        \matrix[name=M, matrix of nodes, column sep=1cm, row sep=1cm]{
            \node[draw,minimum size=1cm]{IQ}; & \node[draw,minimum size=1cm]{Z}; \\
            \node[draw,minimum size=1cm]{JP}; & \node[draw,minimum size=1cm]{R}; \\
        };

        \draw[<->] (M-1-2) edge (M-2-2);
        \draw[<->] (M-1-1) edge (M-2-1);    
        \draw[<->] (M-1-1) edge (M-2-2);
        \draw[<->] (M-2-1) edge (M-2-2);

    \end{tikzpicture}

    \subcaption{MNAR Mechanism}\label{fig:1a}
    \end{minipage}%
%
    \begin{minipage}[b]{.4\linewidth}
    \centering

        \begin{tikzpicture}

            \matrix[name=M, matrix of nodes, column sep=1cm, row sep=1cm]{
                \node[draw,minimum size=1cm]{IQ}; & \node[draw,minimum size=1cm]{Z}; \\
                \node[draw,minimum size=1cm]{JP}; & \node[draw,minimum size=1cm]{R}; \\
            };

            \draw[<->] (M-1-2) edge (M-2-2);
            \draw[<->] (M-1-1) edge (M-2-1);    
            \draw[<->] (M-1-1) edge (M-2-2);

        \end{tikzpicture}

    \subcaption{MAR Mechanism}\label{fig:1b}
    \end{minipage}

    \begin{minipage}[b]{.4\linewidth}
    \centering

        \begin{tikzpicture}

            \matrix[name=M, matrix of nodes, column sep=1cm, row sep=1cm]{
                \node[draw,minimum size=1cm]{IQ}; & \node[draw,minimum size=1cm]{Z}; \\
                \node[draw,minimum size=1cm]{JP}; & \node[draw,minimum size=1cm]{R}; \\
            };

            \draw[<->] (M-1-2) edge (M-2-2);
            \draw[<->] (M-1-1) edge (M-2-1);

        \end{tikzpicture}

    \subcaption{MCAR Mechanism}\label{fig:1b}
    \end{minipage}

    \caption{Figures}\label{fig:1}

\end{figure}

\end{document}

enter image description here

share|improve this answer
    
It is suggestive to use the subfigure environment with a usual \caption command instead of a minipage with \subcaption. As alternative there is the \subcaptionbox command. –  Thorsten Donig Oct 7 '13 at 19:49
    
Excellent job.. Thanks it works exactly the same way I wanted it –  user35571 Oct 8 '13 at 2:27

Here is some code that puts in an approximation of the upper left diagram. By playing with the parameters you can get a better approximation. Enlarge the boxes containing the characters and shrink slightly the boxes containing the frameboxes:

 \documentclass{article}
 \usepackage[barr,pdf]{xy}

\begin{document}
$$\bfig
 \node 1a(0,0)[\framebox{IQ}]
 \node 1b(400,0)[\framebox{Z}]
 \node 2a(0,-400)[\framebox{JP}]
 \node 2b(400,-400)[\framebox{R}]
 \arrow/<->/[1a`1b;]
 \arrow/<->/[1a`2a;]
 \arrow/<->/[1a`2b;]
 \arrow/<->/[2a`2b;]
 \arrow/<->/[1b`2b;]
 \efig$$
\end{document}
share|improve this answer
    
Please, don't use $$ in LaTeX documents (at least not those you present here). –  egreg Oct 7 '13 at 21:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.