2

Does anybody know how to draw a dual time representation in a professional way? Any suggestions for how to do it with LaTeX or other software?

enter image description here

Thanks in advance.

2

This is an attempt where two block styles are defined, one with sharp corners and the other with rounded corners. Here varwidth and enumerate environments from varwith and enumitem packages are used to provide some flexibility.

enter image description here

Code

\documentclass{article}
\usepackage[margin=1cm]{geometry}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\usepackage{varwidth,enumitem,amsmath}
\setlist[enumerate]{labelindent=2pt,leftmargin=*}

\begin{document}
\begin{tikzpicture}[auto,
block/.style ={rectangle, draw=black, thick, fill=white,align=left,execute at begin node=\footnotesize,outer sep=0pt,},
    blockrc/.style ={rectangle, draw=black, thick, fill=white, rounded corners,align=left,execute at begin node=\footnotesize,outer sep=0pt},
    myarr/.style={->,>=latex'}
]
\node [block] (diag1) {
\begin{varwidth}{3cm}
\baselineskip=2pt
\begin{enumerate}
\item[1.] Attend to stimulus sorce, push the buttom marked with green tape and more and more
\end{enumerate}
\end{varwidth}
        }; 
\node [right =  0.5cm of diag1,blockrc,] (1a) {\begin{varwidth}{2.5cm}
        \baselineskip=2pt
\begin{enumerate}
\item[1a.] Be aware of locations. Green locations
\end{enumerate}
\end{varwidth}};
      \node[block,anchor=north west]  at (diag1.south east)(diag2)
        {\begin{varwidth}{2cm}
        \baselineskip=2pt
\begin{enumerate}
\item[2.] Intertrial internal\\ of \\duration
\end{enumerate}
\end{varwidth}
}; 
\node [right= 0.5cm of diag2, blockrc] (2a) {\begin{varwidth}{2cm}
      \baselineskip=2pt
\begin{enumerate}
\item[2a.] Attend stimulus souce
\end{enumerate}
\end{varwidth}}; 

%--- repeated diagonal entries
      \node[block,anchor=north west]  at (diag2.south east)(diag3)
        {\begin{varwidth}{2cm}
        \baselineskip=2pt
\begin{enumerate}
\item[3.] Stimulus light  appears
$i=1$ (green)
$i=2$ (red)
\end{enumerate}
\end{varwidth}
}; 
\node [right=  0.5cm of diag3, blockrc] (3a) {%
\begin{varwidth}{2cm}
\baselineskip=2pt
\begin{enumerate}
\item[3a.] Attend stimulus souce
\end{enumerate}
\end{varwidth}
}; 

\node [below right=  0.2cm and 0.1cm of  3a, blockrc] (3b) {%
\begin{varwidth}{1.5cm}
\baselineskip=2pt
\begin{enumerate}
\item[3b.] Some text here.
\end{enumerate}
\end{varwidth}
}; 

\node [below right=  0.2cm and 0.1cm of  3b, blockrc] (3c) {%
\begin{varwidth}{1.5cm}
\baselineskip=2pt
\begin{enumerate}
\item[3c.] Some text here
\end{enumerate}
\end{varwidth}
}; 

\node [below right=  0.2cm and 0.1cm of  3c, blockrc] (3d) {%
\begin{varwidth}{1.5cm}
\baselineskip=2pt
\begin{enumerate}
\item[3d.] Some text here.
\end{enumerate}
\end{varwidth}
}; 

\node [below right=  0.2cm and 0.1cm of  3d, blockrc] (3e) {%
\begin{varwidth}{1.5cm}
\baselineskip=2pt
\begin{enumerate}
\item[3e.] Some text here
\end{enumerate}
\end{varwidth}
}; 


% last diagonal entry 
\node[block,anchor=north west]  at ([shift={(7cm,-4.5cm)}]diag3.south east)(diag4)
{\begin{varwidth}{1.5cm}
\baselineskip=2pt
\begin{enumerate}[leftmargin=*]
\item[4.] Push buttom $j$
\end{enumerate}
\end{varwidth}
}; 

% draw lines

\draw[myarr] (diag1.east)--(1a.west);    
\draw[myarr] (diag2.east)--(2a.west);
\draw[myarr] (diag3.east)--(3a.west);        
\draw[dashed,myarr] (diag3.south east)--(diag4.north west);    


\draw[myarr] ([xshift=1cm]1a.south)--([xshift=1cm]1a.south |- 2a.north);    
\draw[myarr] (diag2.east)--(2a.west);
\draw[myarr] (diag3.east)--(3a.west); 
\draw[myarr] (3e.south)--(3e.south |- diag4.north); 
\foreach \t in{a,b,c,d,e}{
\draw[myarr,rounded corners] (1a.east)-|(3\t.north); 
}
\foreach \f/\t in{a/b,b/c,c/d,d/e}{
\draw[myarr,rounded corners] (3\f.east)-|(3\t.north); 
}

\draw[-] (diag1.south east) -- ++ (0,-8.5cm)coordinate(a)
(diag2.south east) -- ++ (0,-8cm)coordinate(b)
(diag4.south west) -- ++ (0,-1cm)coordinate(c);
\draw[<->,>=latex'] (a)--node[midway]{Choice of RT}([yshift=0.5cm]c);
\draw[<->,>=latex'] (b)--node[midway]{Repetitions of task}(c);
\node[block,draw=none] [below right = 0.2cm and -1.7cm of diag4]{
$\left .
\begin{aligned}
&\mathtt{Correct:}\, i=j\\
&\mathtt{Error:}\, i \neq j
\end{aligned}
\right \}\Rightarrow
\mathtt{\%Errors}
$};
\node[block,draw=none] [above=1ex of diag1]{INSTRUCTIONS};
\node[block,draw=none] [below=1ex of diag1]{\small  Hand locations is\\ counterbalanced};
\node[block,draw=none] [above=1ex of 1a]{        Reinforced by \\ practice trials};
\node[block,draw=none] [below=1ex of diag2]{        \small  Varies \\ randomly\\ over 4,6,8};
\end{tikzpicture}
\end{document}
  • Wow, thank you. I should discover it line by line :-) – Ehsan Masoudi Feb 5 '15 at 12:49
2

Have a look at tikz, e.g. these examples:

http://www.texample.net/tikz/examples/consort-flowchart/ http://www.texample.net/tikz/examples/bayes/

Edit: ok,hope this helps:

\begin{tikzpicture}
\node[rounded corners=3pt, draw](n1) at (0,0) {Main Node};
\node[rounded corners=3pt, draw](n2) at (2,-1){Node x};
\node[rounded corners=3pt, draw](n3) at (3,-2) {Node y};
\node[rounded corners=3pt, draw](n4) at (4,-3) {Node z};


\draw[rounded corners] (n1) -- (2,0) -- (n2);
\draw[rounded corners] (n1) -- (3,0) -- (n3);
\draw[rounded corners] (n1) -- (4,0) -- (n4);
\end{tikzpicture}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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