Is it possible to draw this network using Tikz?
up vote
4
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
4
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
Nov 28 at 22:43
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
Nov 28 at 22:45
add a comment |
up vote
4
down vote
favorite
up vote
4
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 Nov 28 at 22:49
CarLaTeX
27.8k445121
27.8k445121
New contributor
asked Nov 28 at 22:39
itechi
232
232
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
Nov 28 at 22:43
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
Nov 28 at 22:45
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
Nov 28 at 22:43
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
Nov 28 at 22:45
2
2
welcome to tex.se! yes, it is possible to draw this figure :-). what you try so far? please show us this!
– Zarko
Nov 28 at 22:43
welcome to tex.se! yes, it is possible to draw this figure :-). what you try so far? please show us this!
– Zarko
Nov 28 at 22:43
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
Nov 28 at 22:45
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
Nov 28 at 22:45
add a comment |
2 Answers
2
active
oldest
votes
up vote
6
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
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
6
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
6
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
6
down vote
accepted
up vote
6
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 Nov 28 at 22:52
Torbjørn T.
154k13245433
154k13245433
add a comment |
add a comment |
up vote
5
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
5
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
5
down vote
up vote
5
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 Nov 28 at 23:48
answered Nov 28 at 23:34
AboAmmar
31.6k22781
31.6k22781
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.
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%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
Nov 28 at 22:43
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
Nov 28 at 22:45