Adding labels and comments to a matrixNo tick labels and adding title to groupplot generated plotsTikZ/ERD: node (=Entity) label on the insideTable-like lines in tikz matrixTikz functions and coordinate system: Adding points and labelsAdding simple labels to axes in tikz?Automatically find which nodes are closest, to aid drawing lines within a TikZ matrixAdding comments inside a box on certain slidesAdding Labels and arrows in Tikz graphAdding some simple labelsTikz: Adding Labels to Arrows (Code Given)

What are these arcade games in Ghostbusters 1984?

How do I know what is the origin IP if I ping from a router to a host of an external network in packet tracer?

Why does Mjolnir fall down in Age of Ultron but not in Endgame?

Is real public IP Address hidden when using a system wide proxy in Windows 10?

Pirate democracy at its finest

How strong are Wi-Fi signals?

Binary Search in C++17

Employer asking for online access to bank account - Is this a scam?

Why were helmets and other body armour not commonplace in the 1800s?

What does the view outside my ship traveling at light speed look like?

How to pull out the underlying query syntax being used by dataset?

How do Human Traits Work?

Simple fuzz pedal using breadboard

Why do airplanes use an axial flow jet engine instead of a more compact centrifugal jet engine?

Line of lights moving in a straight line , with a few following

Cipher Block Chaining - How do you change the plaintext of all blocks?

Does the unit of measure matter when you are solving for the diameter of a circumference?

Why does a perfectly-identical repetition of a drawing command given within an earlier loop 𝘯𝘰𝘵 produce exactly the same line?

What is memelemum?

Why are C64 games inconsistent with which joystick port they use?

Is the field of q-series 'dead'?

Is it rude to call a professor by their last name with no prefix in a non-academic setting?

How should I introduce map drawing to my players?

Crossing US border with music files I'm legally allowed to possess



Adding labels and comments to a matrix


No tick labels and adding title to groupplot generated plotsTikZ/ERD: node (=Entity) label on the insideTable-like lines in tikz matrixTikz functions and coordinate system: Adding points and labelsAdding simple labels to axes in tikz?Automatically find which nodes are closest, to aid drawing lines within a TikZ matrixAdding comments inside a box on certain slidesAdding Labels and arrows in Tikz graphAdding some simple labelsTikz: Adding Labels to Arrows (Code Given)













6















Fellows and folks!



I have been fighting to draw what's on the picture for a long time:



enter image description here



I cannot draw those 3 arrows that are pointing to the same comment. Plus, the other two arrows that are pointing to letters "i" and "j". Could you please give me a hand?



This is what I have done so far:



​`beginfigure[H]
centering
begintikzpicture
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,]
R & & ;
foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
node[above, font=scriptsize] 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
draw[dashed] ([shift=(.5mm,-.5mm)]A-i-4.north west) rectangle ([shift=(-.5mm,.5mm)]A-i-6.south east);
endtikzpicture
captionitem based
endfigure`


enter image description here



It does not look good at all. Plus I have done the other version, where I have to calculate the similarity between rows. All I have to do is to transpose the matrix:



enter image description here



beginfigure[H]
centering
begintikzpicture
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,]
R & & ;
foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
node[above, font=scriptsize] 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
draw[dashed] ([shift=(.5mm,-.5mm)]A-i-4.north west) rectangle ([shift=(-.5mm,.5mm)]A-i-6.south east);
endtikzpicture
captionitem based
endfigure


enter image description here










share|improve this question




























    6















    Fellows and folks!



    I have been fighting to draw what's on the picture for a long time:



    enter image description here



    I cannot draw those 3 arrows that are pointing to the same comment. Plus, the other two arrows that are pointing to letters "i" and "j". Could you please give me a hand?



    This is what I have done so far:



    ​`beginfigure[H]
    centering
    begintikzpicture
    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,]
    R & & ;
    foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
    node[above, font=scriptsize] 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
    draw[dashed] ([shift=(.5mm,-.5mm)]A-i-4.north west) rectangle ([shift=(-.5mm,.5mm)]A-i-6.south east);
    endtikzpicture
    captionitem based
    endfigure`


    enter image description here



    It does not look good at all. Plus I have done the other version, where I have to calculate the similarity between rows. All I have to do is to transpose the matrix:



    enter image description here



    beginfigure[H]
    centering
    begintikzpicture
    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,]
    R & & ;
    foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
    node[above, font=scriptsize] 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
    draw[dashed] ([shift=(.5mm,-.5mm)]A-i-4.north west) rectangle ([shift=(-.5mm,.5mm)]A-i-6.south east);
    endtikzpicture
    captionitem based
    endfigure


    enter image description here










    share|improve this question


























      6












      6








      6


      1






      Fellows and folks!



      I have been fighting to draw what's on the picture for a long time:



      enter image description here



      I cannot draw those 3 arrows that are pointing to the same comment. Plus, the other two arrows that are pointing to letters "i" and "j". Could you please give me a hand?



      This is what I have done so far:



      ​`beginfigure[H]
      centering
      begintikzpicture
      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,]
      R & & ;
      foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
      node[above, font=scriptsize] 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
      draw[dashed] ([shift=(.5mm,-.5mm)]A-i-4.north west) rectangle ([shift=(-.5mm,.5mm)]A-i-6.south east);
      endtikzpicture
      captionitem based
      endfigure`


      enter image description here



      It does not look good at all. Plus I have done the other version, where I have to calculate the similarity between rows. All I have to do is to transpose the matrix:



      enter image description here



      beginfigure[H]
      centering
      begintikzpicture
      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,]
      R & & ;
      foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
      node[above, font=scriptsize] 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
      draw[dashed] ([shift=(.5mm,-.5mm)]A-i-4.north west) rectangle ([shift=(-.5mm,.5mm)]A-i-6.south east);
      endtikzpicture
      captionitem based
      endfigure


      enter image description here










      share|improve this question
















      Fellows and folks!



      I have been fighting to draw what's on the picture for a long time:



      enter image description here



      I cannot draw those 3 arrows that are pointing to the same comment. Plus, the other two arrows that are pointing to letters "i" and "j". Could you please give me a hand?



      This is what I have done so far:



      ​`beginfigure[H]
      centering
      begintikzpicture
      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,]
      R & & ;
      foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
      node[above, font=scriptsize] 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
      draw[dashed] ([shift=(.5mm,-.5mm)]A-i-4.north west) rectangle ([shift=(-.5mm,.5mm)]A-i-6.south east);
      endtikzpicture
      captionitem based
      endfigure`


      enter image description here



      It does not look good at all. Plus I have done the other version, where I have to calculate the similarity between rows. All I have to do is to transpose the matrix:



      enter image description here



      beginfigure[H]
      centering
      begintikzpicture
      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,]
      R & & ;
      foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
      node[above, font=scriptsize] 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
      draw[dashed] ([shift=(.5mm,-.5mm)]A-i-4.north west) rectangle ([shift=(-.5mm,.5mm)]A-i-6.south east);
      endtikzpicture
      captionitem based
      endfigure


      enter image description here







      tikz-pgf






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 14 at 5:59









      Stefan Pinnow

      20.5k83578




      20.5k83578










      asked May 13 at 20:04









      naveganteXnaveganteX

      3588




      3588




















          2 Answers
          2






          active

          oldest

          votes


















          7














          Here's one possible option, using the fit and positioning libraries, and relative coordinates for the arrows on top. See comments in the code, ask if I should expand on anything.



          enter image description here



          documentclass[border=5mm]standalone
          usepackagetikz
          usetikzlibrary
          matrix,
          positioning, % added
          fit % added

          begindocument
          begintikzpicture
          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,
          row 4/.style = nodes=fill=lightgray,
          row 6/.style = nodes=fill=lightgray,
          column 7/.style = nodes=minimum width=10mm,]
          [draw,fill=blue!20];

          % draw the box below
          node [draw,
          text width=3cm,
          below=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          foreach i [count=xi] in 1,2,vdots,$i$, ,$j$,vdots,$m-1$,$m$
          node[left, font=scriptsize,name=l-xi] at (A-xi-1.west) istrut;
          foreach i [count=xi] in 1,2,dots,$u$,dots,$n-1$,$n$
          node[above, font=scriptsize] at (A-1-xi.north) istrut;

          foreach i in 1,3,7

          % use the fit library instead of drawing box manually, then you get a node you can refer to
          node [fit=(A-4-i)(A-6-i), inner sep=-0.5mm, draw, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (Ri.south) -- (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 [<-] (l-4) -- coordinate[pos=0.6] (s1) ++(-15mm,0);
          draw [<-] (l-6) -- ++(-15mm,0);
          % 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] $s_i,j=?$ (l-6 -| s1);

          endtikzpicture
          begintikzpicture
          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,]
          R & & ;

          % draw the box on the right
          node [draw,
          text width=3cm,
          right=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          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, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (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 [<-] (t-4) -- coordinate[pos=0.6] (s1) ++(0,15mm);
          draw [<-] (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] $s_i,j=?$ (t-6 |- s1);

          endtikzpicture

          enddocument





          share|improve this answer




















          • 2





            @naveganteX Well, you can use exactly the same techniques for that.

            – Torbjørn T.
            May 13 at 20:47






          • 1





            @naveganteX Basically to transpose the matrix you just have to do it by hand I think, i.e. rewrite it. And change styles/anchors etc. that refer to rows so they refer to columns, and vice versa.

            – Torbjørn T.
            May 13 at 21:00






          • 1





            @naveganteX Did a quick transpose, see updated answer. Might have gotten some things wrong though, but you'll probably be able to fix that, considering where you had gotten to in the first place.

            – Torbjørn T.
            May 13 at 21:06






          • 1





            @naveganteX Replace dashed with rounded corners.

            – Torbjørn T.
            May 13 at 21:21






          • 1





            @naveganteX You already know how to do that ... At least you had done it two places in your original code. font=small (or some other font size switch)

            – Torbjørn T.
            May 13 at 23:17


















          4














          Very similar to Torbjørn T's nice answer except that the border of the comment is as in your figure (and drawn via path picture, i.e. you can make it a style if you use such things more often).



          documentclass[tikz,border=3.14mm]standalone
          usetikzlibrarymatrix,fit,positioning

          begindocument
          begintikzpicture
          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,]
          R & & ;
          foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
          node[above, font=scriptsize] 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;
          node[right=1cm of A,align=left,text width=4cm,path picture=
          draw ([xshift=1em,yshift=-pgflinewidth]path picture bounding box.north west) -] (txt)%
          Some very long text about ducks, koalas and marmots which is very long and deals
          with ducks, koalas and marmots. dots;
          foreach i in 2,4,7
          node[draw,rounded corners,fit=(A-i-4)(A-i-6),inner xsep=-1ex,
          inner ysep=-0.3ex] (F-i);
          draw[-latex] (txt) -- (F-i.east);


          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • The one! Thank you very much! Is there any way that you can transpose the matrix and draw the second model?

            – naveganteX
            May 13 at 20:58






          • 1





            @naveganteX AFAIK there is no automatic way, matrices are very immune to transformations. So one needs to do what Torbjørn T. is saying: transpose it by rewriting it. Any attempt to use transform canvas will extremely likely fail at a given point.

            – marmot
            May 13 at 21:06











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "85"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f490705%2fadding-labels-and-comments-to-a-matrix%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          7














          Here's one possible option, using the fit and positioning libraries, and relative coordinates for the arrows on top. See comments in the code, ask if I should expand on anything.



          enter image description here



          documentclass[border=5mm]standalone
          usepackagetikz
          usetikzlibrary
          matrix,
          positioning, % added
          fit % added

          begindocument
          begintikzpicture
          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,
          row 4/.style = nodes=fill=lightgray,
          row 6/.style = nodes=fill=lightgray,
          column 7/.style = nodes=minimum width=10mm,]
          [draw,fill=blue!20];

          % draw the box below
          node [draw,
          text width=3cm,
          below=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          foreach i [count=xi] in 1,2,vdots,$i$, ,$j$,vdots,$m-1$,$m$
          node[left, font=scriptsize,name=l-xi] at (A-xi-1.west) istrut;
          foreach i [count=xi] in 1,2,dots,$u$,dots,$n-1$,$n$
          node[above, font=scriptsize] at (A-1-xi.north) istrut;

          foreach i in 1,3,7

          % use the fit library instead of drawing box manually, then you get a node you can refer to
          node [fit=(A-4-i)(A-6-i), inner sep=-0.5mm, draw, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (Ri.south) -- (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 [<-] (l-4) -- coordinate[pos=0.6] (s1) ++(-15mm,0);
          draw [<-] (l-6) -- ++(-15mm,0);
          % 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] $s_i,j=?$ (l-6 -| s1);

          endtikzpicture
          begintikzpicture
          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,]
          R & & ;

          % draw the box on the right
          node [draw,
          text width=3cm,
          right=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          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, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (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 [<-] (t-4) -- coordinate[pos=0.6] (s1) ++(0,15mm);
          draw [<-] (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] $s_i,j=?$ (t-6 |- s1);

          endtikzpicture

          enddocument





          share|improve this answer




















          • 2





            @naveganteX Well, you can use exactly the same techniques for that.

            – Torbjørn T.
            May 13 at 20:47






          • 1





            @naveganteX Basically to transpose the matrix you just have to do it by hand I think, i.e. rewrite it. And change styles/anchors etc. that refer to rows so they refer to columns, and vice versa.

            – Torbjørn T.
            May 13 at 21:00






          • 1





            @naveganteX Did a quick transpose, see updated answer. Might have gotten some things wrong though, but you'll probably be able to fix that, considering where you had gotten to in the first place.

            – Torbjørn T.
            May 13 at 21:06






          • 1





            @naveganteX Replace dashed with rounded corners.

            – Torbjørn T.
            May 13 at 21:21






          • 1





            @naveganteX You already know how to do that ... At least you had done it two places in your original code. font=small (or some other font size switch)

            – Torbjørn T.
            May 13 at 23:17















          7














          Here's one possible option, using the fit and positioning libraries, and relative coordinates for the arrows on top. See comments in the code, ask if I should expand on anything.



          enter image description here



          documentclass[border=5mm]standalone
          usepackagetikz
          usetikzlibrary
          matrix,
          positioning, % added
          fit % added

          begindocument
          begintikzpicture
          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,
          row 4/.style = nodes=fill=lightgray,
          row 6/.style = nodes=fill=lightgray,
          column 7/.style = nodes=minimum width=10mm,]
          [draw,fill=blue!20];

          % draw the box below
          node [draw,
          text width=3cm,
          below=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          foreach i [count=xi] in 1,2,vdots,$i$, ,$j$,vdots,$m-1$,$m$
          node[left, font=scriptsize,name=l-xi] at (A-xi-1.west) istrut;
          foreach i [count=xi] in 1,2,dots,$u$,dots,$n-1$,$n$
          node[above, font=scriptsize] at (A-1-xi.north) istrut;

          foreach i in 1,3,7

          % use the fit library instead of drawing box manually, then you get a node you can refer to
          node [fit=(A-4-i)(A-6-i), inner sep=-0.5mm, draw, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (Ri.south) -- (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 [<-] (l-4) -- coordinate[pos=0.6] (s1) ++(-15mm,0);
          draw [<-] (l-6) -- ++(-15mm,0);
          % 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] $s_i,j=?$ (l-6 -| s1);

          endtikzpicture
          begintikzpicture
          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,]
          R & & ;

          % draw the box on the right
          node [draw,
          text width=3cm,
          right=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          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, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (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 [<-] (t-4) -- coordinate[pos=0.6] (s1) ++(0,15mm);
          draw [<-] (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] $s_i,j=?$ (t-6 |- s1);

          endtikzpicture

          enddocument





          share|improve this answer




















          • 2





            @naveganteX Well, you can use exactly the same techniques for that.

            – Torbjørn T.
            May 13 at 20:47






          • 1





            @naveganteX Basically to transpose the matrix you just have to do it by hand I think, i.e. rewrite it. And change styles/anchors etc. that refer to rows so they refer to columns, and vice versa.

            – Torbjørn T.
            May 13 at 21:00






          • 1





            @naveganteX Did a quick transpose, see updated answer. Might have gotten some things wrong though, but you'll probably be able to fix that, considering where you had gotten to in the first place.

            – Torbjørn T.
            May 13 at 21:06






          • 1





            @naveganteX Replace dashed with rounded corners.

            – Torbjørn T.
            May 13 at 21:21






          • 1





            @naveganteX You already know how to do that ... At least you had done it two places in your original code. font=small (or some other font size switch)

            – Torbjørn T.
            May 13 at 23:17













          7












          7








          7







          Here's one possible option, using the fit and positioning libraries, and relative coordinates for the arrows on top. See comments in the code, ask if I should expand on anything.



          enter image description here



          documentclass[border=5mm]standalone
          usepackagetikz
          usetikzlibrary
          matrix,
          positioning, % added
          fit % added

          begindocument
          begintikzpicture
          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,
          row 4/.style = nodes=fill=lightgray,
          row 6/.style = nodes=fill=lightgray,
          column 7/.style = nodes=minimum width=10mm,]
          [draw,fill=blue!20];

          % draw the box below
          node [draw,
          text width=3cm,
          below=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          foreach i [count=xi] in 1,2,vdots,$i$, ,$j$,vdots,$m-1$,$m$
          node[left, font=scriptsize,name=l-xi] at (A-xi-1.west) istrut;
          foreach i [count=xi] in 1,2,dots,$u$,dots,$n-1$,$n$
          node[above, font=scriptsize] at (A-1-xi.north) istrut;

          foreach i in 1,3,7

          % use the fit library instead of drawing box manually, then you get a node you can refer to
          node [fit=(A-4-i)(A-6-i), inner sep=-0.5mm, draw, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (Ri.south) -- (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 [<-] (l-4) -- coordinate[pos=0.6] (s1) ++(-15mm,0);
          draw [<-] (l-6) -- ++(-15mm,0);
          % 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] $s_i,j=?$ (l-6 -| s1);

          endtikzpicture
          begintikzpicture
          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,]
          R & & ;

          % draw the box on the right
          node [draw,
          text width=3cm,
          right=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          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, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (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 [<-] (t-4) -- coordinate[pos=0.6] (s1) ++(0,15mm);
          draw [<-] (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] $s_i,j=?$ (t-6 |- s1);

          endtikzpicture

          enddocument





          share|improve this answer















          Here's one possible option, using the fit and positioning libraries, and relative coordinates for the arrows on top. See comments in the code, ask if I should expand on anything.



          enter image description here



          documentclass[border=5mm]standalone
          usepackagetikz
          usetikzlibrary
          matrix,
          positioning, % added
          fit % added

          begindocument
          begintikzpicture
          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,
          row 4/.style = nodes=fill=lightgray,
          row 6/.style = nodes=fill=lightgray,
          column 7/.style = nodes=minimum width=10mm,]
          [draw,fill=blue!20];

          % draw the box below
          node [draw,
          text width=3cm,
          below=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          foreach i [count=xi] in 1,2,vdots,$i$, ,$j$,vdots,$m-1$,$m$
          node[left, font=scriptsize,name=l-xi] at (A-xi-1.west) istrut;
          foreach i [count=xi] in 1,2,dots,$u$,dots,$n-1$,$n$
          node[above, font=scriptsize] at (A-1-xi.north) istrut;

          foreach i in 1,3,7

          % use the fit library instead of drawing box manually, then you get a node you can refer to
          node [fit=(A-4-i)(A-6-i), inner sep=-0.5mm, draw, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (Ri.south) -- (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 [<-] (l-4) -- coordinate[pos=0.6] (s1) ++(-15mm,0);
          draw [<-] (l-6) -- ++(-15mm,0);
          % 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] $s_i,j=?$ (l-6 -| s1);

          endtikzpicture
          begintikzpicture
          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,]
          R & & ;

          % draw the box on the right
          node [draw,
          text width=3cm,
          right=of A,
          name=textbox
          ] Lorem ipsum dolor sit amet etc. etc. ad infinitum;


          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, dashed, name=Ri] ;
          % draw arrow from textbox node
          draw [<-] (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 [<-] (t-4) -- coordinate[pos=0.6] (s1) ++(0,15mm);
          draw [<-] (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] $s_i,j=?$ (t-6 |- s1);

          endtikzpicture

          enddocument






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 13 at 21:05

























          answered May 13 at 20:41









          Torbjørn T.Torbjørn T.

          160k13262451




          160k13262451







          • 2





            @naveganteX Well, you can use exactly the same techniques for that.

            – Torbjørn T.
            May 13 at 20:47






          • 1





            @naveganteX Basically to transpose the matrix you just have to do it by hand I think, i.e. rewrite it. And change styles/anchors etc. that refer to rows so they refer to columns, and vice versa.

            – Torbjørn T.
            May 13 at 21:00






          • 1





            @naveganteX Did a quick transpose, see updated answer. Might have gotten some things wrong though, but you'll probably be able to fix that, considering where you had gotten to in the first place.

            – Torbjørn T.
            May 13 at 21:06






          • 1





            @naveganteX Replace dashed with rounded corners.

            – Torbjørn T.
            May 13 at 21:21






          • 1





            @naveganteX You already know how to do that ... At least you had done it two places in your original code. font=small (or some other font size switch)

            – Torbjørn T.
            May 13 at 23:17












          • 2





            @naveganteX Well, you can use exactly the same techniques for that.

            – Torbjørn T.
            May 13 at 20:47






          • 1





            @naveganteX Basically to transpose the matrix you just have to do it by hand I think, i.e. rewrite it. And change styles/anchors etc. that refer to rows so they refer to columns, and vice versa.

            – Torbjørn T.
            May 13 at 21:00






          • 1





            @naveganteX Did a quick transpose, see updated answer. Might have gotten some things wrong though, but you'll probably be able to fix that, considering where you had gotten to in the first place.

            – Torbjørn T.
            May 13 at 21:06






          • 1





            @naveganteX Replace dashed with rounded corners.

            – Torbjørn T.
            May 13 at 21:21






          • 1





            @naveganteX You already know how to do that ... At least you had done it two places in your original code. font=small (or some other font size switch)

            – Torbjørn T.
            May 13 at 23:17







          2




          2





          @naveganteX Well, you can use exactly the same techniques for that.

          – Torbjørn T.
          May 13 at 20:47





          @naveganteX Well, you can use exactly the same techniques for that.

          – Torbjørn T.
          May 13 at 20:47




          1




          1





          @naveganteX Basically to transpose the matrix you just have to do it by hand I think, i.e. rewrite it. And change styles/anchors etc. that refer to rows so they refer to columns, and vice versa.

          – Torbjørn T.
          May 13 at 21:00





          @naveganteX Basically to transpose the matrix you just have to do it by hand I think, i.e. rewrite it. And change styles/anchors etc. that refer to rows so they refer to columns, and vice versa.

          – Torbjørn T.
          May 13 at 21:00




          1




          1





          @naveganteX Did a quick transpose, see updated answer. Might have gotten some things wrong though, but you'll probably be able to fix that, considering where you had gotten to in the first place.

          – Torbjørn T.
          May 13 at 21:06





          @naveganteX Did a quick transpose, see updated answer. Might have gotten some things wrong though, but you'll probably be able to fix that, considering where you had gotten to in the first place.

          – Torbjørn T.
          May 13 at 21:06




          1




          1





          @naveganteX Replace dashed with rounded corners.

          – Torbjørn T.
          May 13 at 21:21





          @naveganteX Replace dashed with rounded corners.

          – Torbjørn T.
          May 13 at 21:21




          1




          1





          @naveganteX You already know how to do that ... At least you had done it two places in your original code. font=small (or some other font size switch)

          – Torbjørn T.
          May 13 at 23:17





          @naveganteX You already know how to do that ... At least you had done it two places in your original code. font=small (or some other font size switch)

          – Torbjørn T.
          May 13 at 23:17











          4














          Very similar to Torbjørn T's nice answer except that the border of the comment is as in your figure (and drawn via path picture, i.e. you can make it a style if you use such things more often).



          documentclass[tikz,border=3.14mm]standalone
          usetikzlibrarymatrix,fit,positioning

          begindocument
          begintikzpicture
          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,]
          R & & ;
          foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
          node[above, font=scriptsize] 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;
          node[right=1cm of A,align=left,text width=4cm,path picture=
          draw ([xshift=1em,yshift=-pgflinewidth]path picture bounding box.north west) -] (txt)%
          Some very long text about ducks, koalas and marmots which is very long and deals
          with ducks, koalas and marmots. dots;
          foreach i in 2,4,7
          node[draw,rounded corners,fit=(A-i-4)(A-i-6),inner xsep=-1ex,
          inner ysep=-0.3ex] (F-i);
          draw[-latex] (txt) -- (F-i.east);


          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • The one! Thank you very much! Is there any way that you can transpose the matrix and draw the second model?

            – naveganteX
            May 13 at 20:58






          • 1





            @naveganteX AFAIK there is no automatic way, matrices are very immune to transformations. So one needs to do what Torbjørn T. is saying: transpose it by rewriting it. Any attempt to use transform canvas will extremely likely fail at a given point.

            – marmot
            May 13 at 21:06















          4














          Very similar to Torbjørn T's nice answer except that the border of the comment is as in your figure (and drawn via path picture, i.e. you can make it a style if you use such things more often).



          documentclass[tikz,border=3.14mm]standalone
          usetikzlibrarymatrix,fit,positioning

          begindocument
          begintikzpicture
          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,]
          R & & ;
          foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
          node[above, font=scriptsize] 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;
          node[right=1cm of A,align=left,text width=4cm,path picture=
          draw ([xshift=1em,yshift=-pgflinewidth]path picture bounding box.north west) -] (txt)%
          Some very long text about ducks, koalas and marmots which is very long and deals
          with ducks, koalas and marmots. dots;
          foreach i in 2,4,7
          node[draw,rounded corners,fit=(A-i-4)(A-i-6),inner xsep=-1ex,
          inner ysep=-0.3ex] (F-i);
          draw[-latex] (txt) -- (F-i.east);


          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • The one! Thank you very much! Is there any way that you can transpose the matrix and draw the second model?

            – naveganteX
            May 13 at 20:58






          • 1





            @naveganteX AFAIK there is no automatic way, matrices are very immune to transformations. So one needs to do what Torbjørn T. is saying: transpose it by rewriting it. Any attempt to use transform canvas will extremely likely fail at a given point.

            – marmot
            May 13 at 21:06













          4












          4








          4







          Very similar to Torbjørn T's nice answer except that the border of the comment is as in your figure (and drawn via path picture, i.e. you can make it a style if you use such things more often).



          documentclass[tikz,border=3.14mm]standalone
          usetikzlibrarymatrix,fit,positioning

          begindocument
          begintikzpicture
          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,]
          R & & ;
          foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
          node[above, font=scriptsize] 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;
          node[right=1cm of A,align=left,text width=4cm,path picture=
          draw ([xshift=1em,yshift=-pgflinewidth]path picture bounding box.north west) -] (txt)%
          Some very long text about ducks, koalas and marmots which is very long and deals
          with ducks, koalas and marmots. dots;
          foreach i in 2,4,7
          node[draw,rounded corners,fit=(A-i-4)(A-i-6),inner xsep=-1ex,
          inner ysep=-0.3ex] (F-i);
          draw[-latex] (txt) -- (F-i.east);


          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer













          Very similar to Torbjørn T's nice answer except that the border of the comment is as in your figure (and drawn via path picture, i.e. you can make it a style if you use such things more often).



          documentclass[tikz,border=3.14mm]standalone
          usetikzlibrarymatrix,fit,positioning

          begindocument
          begintikzpicture
          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,]
          R & & ;
          foreach i [count=xi] in 1,2,dots,$i$, ,$j$,dots,$m-1$,$m$
          node[above, font=scriptsize] 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;
          node[right=1cm of A,align=left,text width=4cm,path picture=
          draw ([xshift=1em,yshift=-pgflinewidth]path picture bounding box.north west) -] (txt)%
          Some very long text about ducks, koalas and marmots which is very long and deals
          with ducks, koalas and marmots. dots;
          foreach i in 2,4,7
          node[draw,rounded corners,fit=(A-i-4)(A-i-6),inner xsep=-1ex,
          inner ysep=-0.3ex] (F-i);
          draw[-latex] (txt) -- (F-i.east);


          endtikzpicture
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 13 at 20:55









          marmotmarmot

          130k6164312




          130k6164312












          • The one! Thank you very much! Is there any way that you can transpose the matrix and draw the second model?

            – naveganteX
            May 13 at 20:58






          • 1





            @naveganteX AFAIK there is no automatic way, matrices are very immune to transformations. So one needs to do what Torbjørn T. is saying: transpose it by rewriting it. Any attempt to use transform canvas will extremely likely fail at a given point.

            – marmot
            May 13 at 21:06

















          • The one! Thank you very much! Is there any way that you can transpose the matrix and draw the second model?

            – naveganteX
            May 13 at 20:58






          • 1





            @naveganteX AFAIK there is no automatic way, matrices are very immune to transformations. So one needs to do what Torbjørn T. is saying: transpose it by rewriting it. Any attempt to use transform canvas will extremely likely fail at a given point.

            – marmot
            May 13 at 21:06
















          The one! Thank you very much! Is there any way that you can transpose the matrix and draw the second model?

          – naveganteX
          May 13 at 20:58





          The one! Thank you very much! Is there any way that you can transpose the matrix and draw the second model?

          – naveganteX
          May 13 at 20:58




          1




          1





          @naveganteX AFAIK there is no automatic way, matrices are very immune to transformations. So one needs to do what Torbjørn T. is saying: transpose it by rewriting it. Any attempt to use transform canvas will extremely likely fail at a given point.

          – marmot
          May 13 at 21:06





          @naveganteX AFAIK there is no automatic way, matrices are very immune to transformations. So one needs to do what Torbjørn T. is saying: transpose it by rewriting it. Any attempt to use transform canvas will extremely likely fail at a given point.

          – marmot
          May 13 at 21:06

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f490705%2fadding-labels-and-comments-to-a-matrix%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

          Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

          What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company