I want to draw a diagram like the attached image. can i get some advice enter image description here

enter image description here


Welcome to TeX.SE! There are several possibilities of achieving this, here is one of them based on the matrix library.

\begin{tikzpicture}[mymat/.style={matrix of nodes,
nodes={fill=red,draw,text=white,font=\sffamily\bfseries,text width=1.5cm,
text height=11pt,text depth=3pt,baseline=center},
column sep=-\pgflinewidth/2}]
\matrix[mymat] (matTL) {
Text1 & Text2 & Text3\\
\matrix[mymat,right=2cm of matTL] (matTR) {
V1 & V2 & V3\\
\matrix[mymat,below=2cm of matTL.west,anchor=west] (matBL) {
Text4 & new & Text5 & Text6\\
\draw[-latex] (matTL-1-3) -- (matTR-1-1);
\foreach \X in {1,2,3}
{\draw[-latex] (matBL-1-1) -- (matTL-1-\X);}

enter image description here

Alternatively you may use shapes.multipart.

\begin{tikzpicture}[my shape/.style={rectangle split, rectangle split parts=#1,
fill=red,draw,text=white,font=\sffamily\bfseries,text width=1.5cm,text
height=11pt,text depth=3pt,rectangle split horizontal,
rectangle split part align=base}]
\node [my shape=3] (TL)
\node [my shape=3,right=2cm of TL] (TR)
\node [my shape=4,below=2cm of TL.west,anchor=west] (BL)
\draw[-latex] (TL) -- (TR);
\foreach \X in {one,two,three}
{\draw[-latex] (BL.one north) -- (TL.\X\space south);}

enter image description here

  • Thank you your solution. I just a have a little issue with it. the cells is not alined. – user2869180 Oct 3 '18 at 4:16
  • 1
    @user2869180 What do you mean by "not aligned"? – user121799 Oct 3 '18 at 4:16
  • please check the original post. May be because i add cell to be four and not three cells. – user2869180 Oct 3 '18 at 4:25
  • 1
    @user2869180 I have fixed that. – user121799 Oct 3 '18 at 4:33
  • 1
    @user2869180 You need to use the appropriate anchors, e.g. \draw[-latex] (BL.two south) -- (BBL.one north); or \draw[-latex] (BL.two south) to[out=-90,in=90] (BBL.one north);. – user121799 Oct 3 '18 at 5:26

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.