Is it possible to draw this network using Tikz?
up vote
3
down vote
favorite
I'm trying to draw networks like network in the figure below.
I can draw similar networks using tokens, nodes and edges but the problem is that I can only connect nodes by edges.
What I need is to connect tokens inside nodes by edges like the figure below: (In this example, node R has two tokens. One of them is connected to node A and the other is connected to node B.)
Is it possible to achieve this using Tikz?
Here is what I tried so far:
begin{tikzpicture}[node distance=1.5cm]
begin{scope}
node [place,tokens=1](0)[label=below:$A$]{};
node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0);
node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1);
end{scope}
end{tikzpicture}
tikz-pgf
New contributor
add a comment |
up vote
3
down vote
favorite
I'm trying to draw networks like network in the figure below.
I can draw similar networks using tokens, nodes and edges but the problem is that I can only connect nodes by edges.
What I need is to connect tokens inside nodes by edges like the figure below: (In this example, node R has two tokens. One of them is connected to node A and the other is connected to node B.)
Is it possible to achieve this using Tikz?
Here is what I tried so far:
begin{tikzpicture}[node distance=1.5cm]
begin{scope}
node [place,tokens=1](0)[label=below:$A$]{};
node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0);
node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1);
end{scope}
end{tikzpicture}
tikz-pgf
New contributor
2
welcome to tex.se! yes, it is possible to draw this figure :-). what you try so far? please show us this!
– Zarko
6 hours ago
Thanks :) Here is what I tried so far: begin{tikzpicture}[node distance=1.5cm] begin{scope} node [place,tokens=1](0)[label=below:$A$]{}; node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0); node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1); end{scope} end{tikzpicture}
– itechi
6 hours ago
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'm trying to draw networks like network in the figure below.
I can draw similar networks using tokens, nodes and edges but the problem is that I can only connect nodes by edges.
What I need is to connect tokens inside nodes by edges like the figure below: (In this example, node R has two tokens. One of them is connected to node A and the other is connected to node B.)
Is it possible to achieve this using Tikz?
Here is what I tried so far:
begin{tikzpicture}[node distance=1.5cm]
begin{scope}
node [place,tokens=1](0)[label=below:$A$]{};
node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0);
node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1);
end{scope}
end{tikzpicture}
tikz-pgf
New contributor
I'm trying to draw networks like network in the figure below.
I can draw similar networks using tokens, nodes and edges but the problem is that I can only connect nodes by edges.
What I need is to connect tokens inside nodes by edges like the figure below: (In this example, node R has two tokens. One of them is connected to node A and the other is connected to node B.)
Is it possible to achieve this using Tikz?
Here is what I tried so far:
begin{tikzpicture}[node distance=1.5cm]
begin{scope}
node [place,tokens=1](0)[label=below:$A$]{};
node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0);
node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1);
end{scope}
end{tikzpicture}
tikz-pgf
tikz-pgf
New contributor
New contributor
edited 6 hours ago
CarLaTeX
27.5k445120
27.5k445120
New contributor
asked 6 hours ago
itechi
182
182
New contributor
New contributor
2
welcome to tex.se! yes, it is possible to draw this figure :-). what you try so far? please show us this!
– Zarko
6 hours ago
Thanks :) Here is what I tried so far: begin{tikzpicture}[node distance=1.5cm] begin{scope} node [place,tokens=1](0)[label=below:$A$]{}; node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0); node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1); end{scope} end{tikzpicture}
– itechi
6 hours ago
add a comment |
2
welcome to tex.se! yes, it is possible to draw this figure :-). what you try so far? please show us this!
– Zarko
6 hours ago
Thanks :) Here is what I tried so far: begin{tikzpicture}[node distance=1.5cm] begin{scope} node [place,tokens=1](0)[label=below:$A$]{}; node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0); node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1); end{scope} end{tikzpicture}
– itechi
6 hours ago
2
2
welcome to tex.se! yes, it is possible to draw this figure :-). what you try so far? please show us this!
– Zarko
6 hours ago
welcome to tex.se! yes, it is possible to draw this figure :-). what you try so far? please show us this!
– Zarko
6 hours ago
Thanks :) Here is what I tried so far: begin{tikzpicture}[node distance=1.5cm] begin{scope} node [place,tokens=1](0)[label=below:$A$]{}; node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0); node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1); end{scope} end{tikzpicture}
– itechi
6 hours ago
Thanks :) Here is what I tried so far: begin{tikzpicture}[node distance=1.5cm] begin{scope} node [place,tokens=1](0)[label=below:$A$]{}; node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0); node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1); end{scope} end{tikzpicture}
– itechi
6 hours ago
add a comment |
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
One of many possible methods:
documentclass[border=5mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, fit}
begin{document}
begin{tikzpicture}[
dot/.style={fill,circle, minimum size=5pt,inner sep=0,node contents={}},
circ/.style={draw, circle, minimum size=10pt,inner sep=0pt, node contents={}}
]
node [dot, name=n1];
node [dot, name=n2, right=of n1];
node [dot, name=n3, right=5mm of n2];
node [dot, name=n4, right=of n3];
draw (n1) -- (n2) (n3) -- (n4);
node [circ,fit=(n2)(n3), label={[name=R]below:R}];
node [circ, left, at=(n1.east), name=A];
node [circ, right, at=(n4.west), name=B];
node at (A |- R) {A};
node at (B |- R) {B};
end{tikzpicture}
end{document}
add a comment |
up vote
2
down vote
Simply using the arrows.meta
library, the Circle
tip can be used and customized as you want, e.g, >={Circle[length=5pt]}, shorten >= -5pt, shorten <= -5pt
will use a 5pt
filled circle and will also lengthen the line by the same amount in both sides. If you want the tip touch the circle from inside, just subtract another pgflinewidth
from the above.
documentclass[tikz,12pt]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[>={Circle[length=5pt]}, shorten >= -5pt-pgflinewidth, shorten <= -5pt-pgflinewidth]
node(a) at (0,0) [draw,circle,minimum size=.5cm]{};
node(r) at (2,0) [draw,circle,minimum size=1cm]{};
node(b) at (4,0) [draw,circle,minimum size=.5cm]{};
node at ([yshift=-2em]a) {A};
node at ([yshift=-2em]r) {R};
node at ([yshift=-2em]b) {B};
draw[<->] (a) -- (r);
draw[<->] (r) -- (b);
end{tikzpicture}
end{document
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
One of many possible methods:
documentclass[border=5mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, fit}
begin{document}
begin{tikzpicture}[
dot/.style={fill,circle, minimum size=5pt,inner sep=0,node contents={}},
circ/.style={draw, circle, minimum size=10pt,inner sep=0pt, node contents={}}
]
node [dot, name=n1];
node [dot, name=n2, right=of n1];
node [dot, name=n3, right=5mm of n2];
node [dot, name=n4, right=of n3];
draw (n1) -- (n2) (n3) -- (n4);
node [circ,fit=(n2)(n3), label={[name=R]below:R}];
node [circ, left, at=(n1.east), name=A];
node [circ, right, at=(n4.west), name=B];
node at (A |- R) {A};
node at (B |- R) {B};
end{tikzpicture}
end{document}
add a comment |
up vote
5
down vote
accepted
One of many possible methods:
documentclass[border=5mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, fit}
begin{document}
begin{tikzpicture}[
dot/.style={fill,circle, minimum size=5pt,inner sep=0,node contents={}},
circ/.style={draw, circle, minimum size=10pt,inner sep=0pt, node contents={}}
]
node [dot, name=n1];
node [dot, name=n2, right=of n1];
node [dot, name=n3, right=5mm of n2];
node [dot, name=n4, right=of n3];
draw (n1) -- (n2) (n3) -- (n4);
node [circ,fit=(n2)(n3), label={[name=R]below:R}];
node [circ, left, at=(n1.east), name=A];
node [circ, right, at=(n4.west), name=B];
node at (A |- R) {A};
node at (B |- R) {B};
end{tikzpicture}
end{document}
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
One of many possible methods:
documentclass[border=5mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, fit}
begin{document}
begin{tikzpicture}[
dot/.style={fill,circle, minimum size=5pt,inner sep=0,node contents={}},
circ/.style={draw, circle, minimum size=10pt,inner sep=0pt, node contents={}}
]
node [dot, name=n1];
node [dot, name=n2, right=of n1];
node [dot, name=n3, right=5mm of n2];
node [dot, name=n4, right=of n3];
draw (n1) -- (n2) (n3) -- (n4);
node [circ,fit=(n2)(n3), label={[name=R]below:R}];
node [circ, left, at=(n1.east), name=A];
node [circ, right, at=(n4.west), name=B];
node at (A |- R) {A};
node at (B |- R) {B};
end{tikzpicture}
end{document}
One of many possible methods:
documentclass[border=5mm]{standalone}
usepackage{tikz}
usetikzlibrary{positioning, fit}
begin{document}
begin{tikzpicture}[
dot/.style={fill,circle, minimum size=5pt,inner sep=0,node contents={}},
circ/.style={draw, circle, minimum size=10pt,inner sep=0pt, node contents={}}
]
node [dot, name=n1];
node [dot, name=n2, right=of n1];
node [dot, name=n3, right=5mm of n2];
node [dot, name=n4, right=of n3];
draw (n1) -- (n2) (n3) -- (n4);
node [circ,fit=(n2)(n3), label={[name=R]below:R}];
node [circ, left, at=(n1.east), name=A];
node [circ, right, at=(n4.west), name=B];
node at (A |- R) {A};
node at (B |- R) {B};
end{tikzpicture}
end{document}
answered 6 hours ago
Torbjørn T.
153k13245433
153k13245433
add a comment |
add a comment |
up vote
2
down vote
Simply using the arrows.meta
library, the Circle
tip can be used and customized as you want, e.g, >={Circle[length=5pt]}, shorten >= -5pt, shorten <= -5pt
will use a 5pt
filled circle and will also lengthen the line by the same amount in both sides. If you want the tip touch the circle from inside, just subtract another pgflinewidth
from the above.
documentclass[tikz,12pt]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[>={Circle[length=5pt]}, shorten >= -5pt-pgflinewidth, shorten <= -5pt-pgflinewidth]
node(a) at (0,0) [draw,circle,minimum size=.5cm]{};
node(r) at (2,0) [draw,circle,minimum size=1cm]{};
node(b) at (4,0) [draw,circle,minimum size=.5cm]{};
node at ([yshift=-2em]a) {A};
node at ([yshift=-2em]r) {R};
node at ([yshift=-2em]b) {B};
draw[<->] (a) -- (r);
draw[<->] (r) -- (b);
end{tikzpicture}
end{document
add a comment |
up vote
2
down vote
Simply using the arrows.meta
library, the Circle
tip can be used and customized as you want, e.g, >={Circle[length=5pt]}, shorten >= -5pt, shorten <= -5pt
will use a 5pt
filled circle and will also lengthen the line by the same amount in both sides. If you want the tip touch the circle from inside, just subtract another pgflinewidth
from the above.
documentclass[tikz,12pt]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[>={Circle[length=5pt]}, shorten >= -5pt-pgflinewidth, shorten <= -5pt-pgflinewidth]
node(a) at (0,0) [draw,circle,minimum size=.5cm]{};
node(r) at (2,0) [draw,circle,minimum size=1cm]{};
node(b) at (4,0) [draw,circle,minimum size=.5cm]{};
node at ([yshift=-2em]a) {A};
node at ([yshift=-2em]r) {R};
node at ([yshift=-2em]b) {B};
draw[<->] (a) -- (r);
draw[<->] (r) -- (b);
end{tikzpicture}
end{document
add a comment |
up vote
2
down vote
up vote
2
down vote
Simply using the arrows.meta
library, the Circle
tip can be used and customized as you want, e.g, >={Circle[length=5pt]}, shorten >= -5pt, shorten <= -5pt
will use a 5pt
filled circle and will also lengthen the line by the same amount in both sides. If you want the tip touch the circle from inside, just subtract another pgflinewidth
from the above.
documentclass[tikz,12pt]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[>={Circle[length=5pt]}, shorten >= -5pt-pgflinewidth, shorten <= -5pt-pgflinewidth]
node(a) at (0,0) [draw,circle,minimum size=.5cm]{};
node(r) at (2,0) [draw,circle,minimum size=1cm]{};
node(b) at (4,0) [draw,circle,minimum size=.5cm]{};
node at ([yshift=-2em]a) {A};
node at ([yshift=-2em]r) {R};
node at ([yshift=-2em]b) {B};
draw[<->] (a) -- (r);
draw[<->] (r) -- (b);
end{tikzpicture}
end{document
Simply using the arrows.meta
library, the Circle
tip can be used and customized as you want, e.g, >={Circle[length=5pt]}, shorten >= -5pt, shorten <= -5pt
will use a 5pt
filled circle and will also lengthen the line by the same amount in both sides. If you want the tip touch the circle from inside, just subtract another pgflinewidth
from the above.
documentclass[tikz,12pt]{standalone}
usetikzlibrary{arrows.meta}
begin{document}
begin{tikzpicture}[>={Circle[length=5pt]}, shorten >= -5pt-pgflinewidth, shorten <= -5pt-pgflinewidth]
node(a) at (0,0) [draw,circle,minimum size=.5cm]{};
node(r) at (2,0) [draw,circle,minimum size=1cm]{};
node(b) at (4,0) [draw,circle,minimum size=.5cm]{};
node at ([yshift=-2em]a) {A};
node at ([yshift=-2em]r) {R};
node at ([yshift=-2em]b) {B};
draw[<->] (a) -- (r);
draw[<->] (r) -- (b);
end{tikzpicture}
end{document
edited 5 hours ago
answered 5 hours ago
AboAmmar
31.5k22781
31.5k22781
add a comment |
add a comment |
itechi is a new contributor. Be nice, and check out our Code of Conduct.
itechi is a new contributor. Be nice, and check out our Code of Conduct.
itechi is a new contributor. Be nice, and check out our Code of Conduct.
itechi is a new contributor. Be nice, and check out our Code of Conduct.
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%2f462269%2fis-it-possible-to-draw-this-network-using-tikz%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
2
welcome to tex.se! yes, it is possible to draw this figure :-). what you try so far? please show us this!
– Zarko
6 hours ago
Thanks :) Here is what I tried so far: begin{tikzpicture}[node distance=1.5cm] begin{scope} node [place,tokens=1](0)[label=below:$A$]{}; node [place,tokens=2] (1) [right of=0,label=below:$R$] {} edge (0); node [place,tokens=1] (2) [right of=1,label=below:$B$] {} edge (1); end{scope} end{tikzpicture}
– itechi
6 hours ago