enter image description here

I'm trying to draw above image. What I've got so far is:

enter image description here

Not very close. I'm struggling in leveling outer box and first box and also drawing arrows. I'm not sure when I'm anchoring to north, why would there be so much mis-match. Code is below:

  \node [draw=black,rotate=90,anchor=north,minimum width=3cm,minimum height=0.75cm] (io) {I/O interface};
  \node [draw=black,minimum width=3cm,minimum height=0.75cm, right =1cm of io] (io2) {SSD System};
  \node [draw=black,minimum width=3cm,minimum height=0.75cm, below =0.32cm of io2] (io3) {Fuzzy Logic ACC};
  \draw[red,thick,dotted] ($(io2.north west)+(-0.1,0.22)$)  rectangle ($(io3.south east)+(0.1,-0.22)$);

Any help, suggestions or ideas would be appreciated. Thank you!

EDIT: With Kevin's answer I'm able to make good progress, this is what I've got so far. I got somewhat arrows drawn, now I need to figure out how to make text and put labels beside I/O interface.

:enter image description here


I would place the io node relative to the io2-io3 block. This way, io can be vertically centered relative to the other two nodes.



    box/.style={draw=black,minimum width=3cm,minimum height=.75cm},
  \node(io2)[box]{SSD System};
  \node(io3)[box,below=.32cm of io2]{Fuzzy Logic ACC};
  \draw[red,thick,dotted] ($(io2.north west)+(-0.1,0.22)$) rectangle ($(io3.south east)+(0.1,-0.22)$);  
  \coordinate(mid left)at($(io2.west)!.5!(io3.west)$);
  \node(io)[box,rotate=90,left=1cm of mid left,anchor=center]{I/O interface};

  % drawing arrows
  \path(io.south west)--(io.south east) coordinate[pos=.33](x1) coordinate[pos=.67](x2);

  \path(io2.south west)--(io2.south east) coordinate[pos=.33](y1) coordinate[pos=.67](y2);

  \path(io.north east)--(io.north west) coordinate[pos=.2](z1) coordinate[pos=.4](z2) coordinate[pos=.6](z3) coordinate[pos=.8](z4);
  \draw[<-](z1)--+(-.5,0) node[anchor=east]{Distance Sensor};
  \draw[<-](z2)--+(-.5,0) node[anchor=east]{Video Input};
  \draw[<-](z3)--+(-.5,0) node[anchor=east]{Set Speed Limit};
  \draw[->](z4)--+(-.5,0) node[anchor=east]{Factored Acceleration};


enter image description here

  • Thank you. Is it possible to draw arrow from I/O to red dotted block? – Shivam Jan 8 '14 at 4:31
  • @ShivamKalra: See my updated answer. – Herr K. Jan 8 '14 at 5:01
  • 2
    You can also use fit for red dotted rectangle. – user11232 Jan 8 '14 at 5:20

Another solution

enter image description here

\tikzstyle{line} = [draw, -latex']
  \node [draw=black,rotate=90,minimum width=3cm,minimum height=0.75cm]  (io) {I/O interface};
  \node [xshift=1cm,draw=black, minimum width=3cm,minimum height=0.75cm, below right =0.7cm of io]          (io2) {SSD System};
  \node [draw=black, minimum width=3cm,minimum height=0.75cm, below =0.35cm of io2] (io3) {Fuzzy Logic ACC};
 \draw [line] ([xshift=-0.5cm]io2.south)--([xshift=-0.5cm]io3.north);
 \draw [line] ([xshift=0.5cm]io3.north)--([xshift=0.5cm]io2.south);
  \node [fit=(io2)(io3),  draw,  inner sep=0.5cm](Box){};
  \draw [line] ([shift={(-3cm,1cm)}]io.north) node (a) {Distance center} +(2,0) -- (a-|io.north);
 \draw [line] ([shift={(-3cm,0.5cm)}]io.north) node (b) {Distance Sensor} +(2,0) -- (b-|io.north);
 \draw [line] ([shift={(-3cm,0cm)}]io.north) node (c) {Vedio Input} +(2,0)-- (c-|io.north);
 \draw [line] ([shift={(-3cm,-0.5cm)}]io.north) node (d) {Set Speed Limit} +(2,0)-- (d-|io.north);
 \draw [latex'-] ([shift={(-3cm,-1cm)}]io.north) node (e) {Factored Acceleration} +(2,0)-- (e-|io.north);
  \node[anchor=south,at=(Box.north)]  {ADAS};
\draw [line] ([shift={(0.4,-1cm)}]io.east) node(f){} -- (f-|Box.west){};
\draw [latex'-] ([shift={(0.4,-2cm)}]io.east) node(g){} -- (g-|Box.west){};

Another solution using fit library.

\tikzset{decision/.style = {diamond, draw, fill=blue!20, text width=4.5em, text badly centered, node
                            distance=3cm, inner sep=0pt},
         block/.style    = {rectangle, draw, fill=black!25, text width=5em, text centered, rounded
                            corners, minimum height=4em},
         line/.style     = {draw, -latex'},
         cloud/.style    = {draw, ellipse,fill=red!20, node distance=3cm, minimum height=2em}
        \node [draw=black,minimum width=3cm,minimum height=0.85cm] (io2) {SSD System};
        \node [draw=black,minimum width=3cm,minimum height=0.85cm, below =0.32cm of io2] (io3) {Fuzzy Logic ACC};
        \draw [latex-] ($(io2.south east)!0.33!(io2.south west)$) -- ($(io3.north east)!0.33!(io3.north west)$);
        \draw [-latex] ($(io2.south east)!0.66!(io2.south west)$) -- ($(io3.north east)!0.66!(io3.north west)$);
        \node[fit=(io2) (io3), draw=red, dotted,minimum height=3cm] (fit) {};
        \node[anchor=south] at (fit.north) {ADAS};
        \node [draw=black,rotate=90,anchor=north,minimum width=3cm,minimum height=0.75cm,left=1cm of fit,anchor=south] (io) {I/O interface};
        \draw[-latex] ($(io.south east)!0.3!(io.south west)$) -- ($(fit.north west)!0.3!(fit.south west)$);
        \draw[latex-] ($(io.south east)!0.7!(io.south west)$) -- ($(fit.north west)!0.7!(fit.south west)$);
        \foreach \x/\a in {0.2/2,0.4/4,0.6/6,0.8/8}{
        \coordinate (z\a) at ($(io.north east)!\x!(io.north west)$);
        \draw[latex-](z2)--+(-.5,0) node[anchor=east]{Distance Sensor};
        \draw[latex-](z4)--+(-.5,0) node[anchor=east]{Video Input};
        \draw[latex-](z6)--+(-.5,0) node[anchor=east]{Set Speed Limit};
        \draw[-latex](z8)--+(-.5,0) node[anchor=east,minimum width=3.1cm,align=left]{Factored \\ Acceleration}; 

enter image description here

  • I was just trying to update my answer using fit. But I guess there's no need now :) – Herr K. Jan 8 '14 at 6:25
  • @KevinC Ohho!. Sorry Kevin. I think I would have waited :-) – user11232 Jan 8 '14 at 6: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.