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)
Fellows and folks!
I have been fighting to draw what's on the picture for a long time:
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`
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:
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
tikz-pgf
add a comment |
Fellows and folks!
I have been fighting to draw what's on the picture for a long time:
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`
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:
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
tikz-pgf
add a comment |
Fellows and folks!
I have been fighting to draw what's on the picture for a long time:
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`
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:
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
tikz-pgf
Fellows and folks!
I have been fighting to draw what's on the picture for a long time:
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`
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:
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
tikz-pgf
tikz-pgf
edited May 14 at 5:59
Stefan Pinnow
20.5k83578
20.5k83578
asked May 13 at 20:04
naveganteXnaveganteX
3588
3588
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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.
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
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 Replacedashed
withrounded 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
|
show 3 more comments
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
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 usetransform canvas
will extremely likely fail at a given point.
– marmot
May 13 at 21:06
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
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 Replacedashed
withrounded 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
|
show 3 more comments
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.
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
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 Replacedashed
withrounded 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
|
show 3 more comments
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.
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
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.
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
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 Replacedashed
withrounded 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
|
show 3 more comments
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 Replacedashed
withrounded 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
|
show 3 more comments
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
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 usetransform canvas
will extremely likely fail at a given point.
– marmot
May 13 at 21:06
add a comment |
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
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 usetransform canvas
will extremely likely fail at a given point.
– marmot
May 13 at 21:06
add a comment |
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
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
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 usetransform canvas
will extremely likely fail at a given point.
– marmot
May 13 at 21:06
add a comment |
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 usetransform 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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