2

I am trying to draw an image like the below one using Tikz. However, as I am a beginner of Tikz, I am having a hard time to accomplish this. Any help is highly appreciated. Thanks

enter image description here

Ignasi
  • 136,588
jhon_wick
  • 629
  • See if http://tex.stackexchange.com/questions/292260/bit-string-diagram-with-latex/292264#292264 can help you. On this basis you can start to draw your image. – Zarko Feb 14 '16 at 00:24
  • Hmm... Hard to help without know what you are having a hard time with exactly. If you post the code you've got, we'll have a better idea what the hard time is about and might be able to make it a bit less hard of a time. – cfr Feb 14 '16 at 02:03
  • tex.stackexchange.com/questions/283652/drawing-a-lattice-scheme-with-latex/283681#283681 also has arrows. http://tex.stackexchange.com/questions/207075/drawing-arcs-on-a-number-line may be helpful, although it is hard to tell at a glance. – cfr Feb 14 '16 at 02:10

1 Answers1

5

For starting point can serve the following code, which prvide part of your wish:

\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{arrows.meta,chains,matrix,decorations.pathreplacing}

\begin{document}
    \begin{tikzpicture}[
node distance=0pt,
 start chain = A going right,
arrow/.style = {draw=#1,-{Stealth[]}, 
                shorten >=1mm, shorten <=1mm}, % styles of arrows
arrow/.default = black,
    X/.style = {rectangle, draw,% styles of nodes in string (chain)
                minimum width=2ex, minimum height=3ex,
                outer sep=0pt, on chain},
    B/.style = {decorate,
                decoration={brace, amplitude=5pt,
                pre=moveto,pre length=1pt,post=moveto,post length=1pt,
                raise=1mm,
                            #1}, % for mirroring of brace, if necessary
                thick},
   B/.default = mirror, % by default braces are mirrored
                        ]
\foreach \i in {1,0,0,0,1,1,
                2,0,3,4,1,2}% <-- content of nodes
    \node[X] {\i};
\matrix (ML) [matrix of nodes,
              nodes=draw, dashed, row sep=1mm,
              row 1 column 1/.style={draw=red},
              left=11mm of A-1]
{   
    1\ 0\\
    0\ 0\\
    1\ 1\\
};
\draw   (ML.north -| ML-1-1.north west) -| 
        (ML.south west) --
        (ML.south -| ML-3-1.south west)
%        
        (ML.north -| ML-1-1.north east) -|
        (ML.south east) --
        (ML.south -| ML-3-1.south east)
        ;

\matrix (MR) [matrix of nodes,
              nodes=draw, dashed, row sep=1mm,
              row 1 column 1/.style={draw=red},
              right=11mm of A-12]
{   1\ 0\\
    0\ 0\\
    1\ 1\\
};
\draw   (MR.north -| MR-1-1.north west) -|
        (MR.south west) --
        (MR.south -| MR-3-1.south west)
%
        (MR.north -| MR-1-1.north east) -|
        (MR.south east) --
        (MR.south -| MR-3-1.south east)
        ;
\draw[B=,red]   (A-1.north west) -- coordinate[above=3mm] (a) (A-2.north east);
\draw[arrow] (ML-1-1.north) to [out=60, in=120] (a);
\draw[B]        (A-3.south west) -- coordinate[below=3mm] (b) (A-4.south east);
\draw[arrow] (ML-2-1.south) to [out=315, in=210] (b);
\draw[B]        (A-5.south west) -- coordinate[below=3mm] (c) (A-6.south east);
\draw[arrow] (ML-3-1.south) to [out=315, in=240] (c);


    \end{tikzpicture}
\end{document}

Its draw:

enter image description here

I thing that missing part of your desired images -- main part is determined by above code -- is relatively straightforward add. If in this you will have problems, just ask where you stuck.

Zarko
  • 296,517
  • I have done the rest of the parts. Thank u very much for your wonderful answer. I have learned from studying your code. Thanks again. @zarko. – jhon_wick Feb 14 '16 at 16:18