Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin{figure}[htbp]
- centering
- begin{tikzpicture}
- matrix (A) [matrix of math nodes, nodes in empty cells,
- nodes={draw, minimum width=8mm, minimum height=5mm, outer sep=0pt, anchor=center},
- row sep=-pgflinewidth, column sep=-pgflinewidth,
- row 3/.style = {nodes={minimum height=8mm}},
- row 5/.style = {nodes={minimum height=8mm}},
- column 3/.style = {nodes={minimum width=10mm}},
- column 4/.style = {nodes={fill=lightgray}},
- column 6/.style = {nodes={fill=lightgray}},
- column 7/.style = {nodes={minimum width=10mm}},]
- { & & & c & & ? & & & \
- & & & |[draw,fill=blue!20]|c & & |[draw,fill=blue!20]|c & & & \
- & & & & & & & & \
- & & & |[draw,fill=blue!20]|c & & |[draw,fill=blue!20]|c & & & \
- & & & & & & & & \
- & & & ? & & c& & & \
- & & & |[draw,fill=blue!20]|c & &|[draw,fill=blue!20]| c& & & \};
- % draw the box on the right
- node [draw,font = footnotesize,
- text width=3cm,
- right=of A,
- name=textbox
- ] {Similarity $d_{ij}$ between items.};
- foreach i [count=xi] in {1,2,dots,$i$, ,$j$,dots,$m-1$,$m$}
- % added name=t-xi to the following
- node[above, font=scriptsize, name=t-xi] at (A-1-xi.north) {istrut};
- foreach i [count=xi] in {1,2,vdots,$u$,vdots,$n-1$,$n$}
- node[left, font=scriptsize] at (A-xi-1.west) {istrut};
- foreach i in {2,4,7}
- {
- % use the fit library instead of drawing box manually, then you get a node you can refer to
- node [fit=(A-i-4)(A-i-6), inner sep=-0.5mm, draw, rounded corners, name=Ri] {};
- % draw arrow from textbox node
- draw [latex-] (Ri.east) -- (textbox);
- }
- % draw arrows from the nodes using the names defined with the modification of the loop above
- % and relative coordinates. Add helper coordinate on the first arrow
- draw [latex-] (t-4) -- coordinate[pos=0.6] (s1) ++(0,15mm);
- draw [latex-] (t-6) -- ++(0,15mm);
- % draw arrow between the helper coordinate s1 and the point that has the x-coordinate of t-6 and the y-coordinate of s1
- draw [<->] (s1) -- node[fill=white,font=scriptsize,inner sep=1pt] {$d_{ij}=?$} (t-6 |- s1);
- end{tikzpicture}
- end{figure}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement