# Drawing figures in LaTeX

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

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

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}


-
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/<->/[1a1b;] \arrow/<->/[1a2a;] \arrow/<->/[1a2b;] \arrow/<->/[2a2b;] \arrow/<->/[1b2b;] \efig$$
\end{document}

-
Please, don't use ` in LaTeX documents (at least not those you present here). –  egreg Oct 7 '13 at 21:06