How to draw this diagram/graph using tikz? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How to draw stack diagram with TiKz?Cannot draw this diagram using tikz-cdHow to refine this tikz diagram?How to draw vertical spiral using TiKZ?How to draw this simple box diagram with TikzTikz: Better way to draw this simple diagramDraw diagram in TikZPhasor summation using tikzCan I draw this diagram in Tikz?How to draw/optimize this graph with tikz
Flight departed from the gate 5 min before scheduled departure time. Refund options
Fit odd number of triplets in a measure?
Is this Kuo-toa homebrew race balanced?
How do I say "this must not happen"?
Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?
What is a more techy Technical Writer job title that isn't cutesy or confusing?
Did any compiler fully use 80-bit floating point?
Twin's vs. Twins'
Can the Haste spell grant both a Beast Master ranger and their animal companion extra attacks?
Noise in Eigenvalues plot
How could a hydrazine and N2O4 cloud (or it's reactants) show up in weather radar?
How much damage would a cupful of neutron star matter do to the Earth?
Keep at all times, the minus sign above aligned with minus sign below
Is there a verb for listening stealthily?
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
Typical Calculus BC Separation of Variables Question
Can two people see the same photon?
Do i imagine the linear (straight line) homotopy in a correct way?
Does a random sequence of vectors span a Hilbert space?
Pointing to problems without suggesting solutions
How to make triangles with rounded sides and corners? (squircle with 3 sides)
Derived column in a data extension
Does the transliteration of 'Dravidian' exist in Hindu scripture? Does 'Dravida' refer to a Geographical area or an ethnic group?
Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?
How to draw this diagram/graph using tikz?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How to draw stack diagram with TiKz?Cannot draw this diagram using tikz-cdHow to refine this tikz diagram?How to draw vertical spiral using TiKZ?How to draw this simple box diagram with TikzTikz: Better way to draw this simple diagramDraw diagram in TikZPhasor summation using tikzCan I draw this diagram in Tikz?How to draw/optimize this graph with tikz
I have this diagram, and I have tried to draw it doing every dot and line, but I was wondering, is there a way to do it with foreach cycles or something like that? thanks.

tikz-pgf diagrams
add a comment |
I have this diagram, and I have tried to draw it doing every dot and line, but I was wondering, is there a way to do it with foreach cycles or something like that? thanks.

tikz-pgf diagrams
4
What have you tried so far? Anyway you are not a new user anymore
– JouleV
yesterday
2
@close-voters: The OP hasn't been online for 2 hours, i.e. he doesn't know what is going on yet. Give him some time.
– JouleV
yesterday
@JouleV Questions can also be reopened. In its current state it is unclear. Therefore voting to close.
– Henri Menke
yesterday
@HenriMenke The question is not unclear. OP informs us that he/she have solved the problem, but the code used is not optimal OP then asks if somebody may give him a tip how to solve the same with a loop or similar. OP does not ask you to write the code, just provide a hint, as JouleV has done.
– Sveinung
yesterday
add a comment |
I have this diagram, and I have tried to draw it doing every dot and line, but I was wondering, is there a way to do it with foreach cycles or something like that? thanks.

tikz-pgf diagrams
I have this diagram, and I have tried to draw it doing every dot and line, but I was wondering, is there a way to do it with foreach cycles or something like that? thanks.

tikz-pgf diagrams
tikz-pgf diagrams
edited yesterday
JouleV
14.8k22666
14.8k22666
asked yesterday
J.RodriguezJ.Rodriguez
3266
3266
4
What have you tried so far? Anyway you are not a new user anymore
– JouleV
yesterday
2
@close-voters: The OP hasn't been online for 2 hours, i.e. he doesn't know what is going on yet. Give him some time.
– JouleV
yesterday
@JouleV Questions can also be reopened. In its current state it is unclear. Therefore voting to close.
– Henri Menke
yesterday
@HenriMenke The question is not unclear. OP informs us that he/she have solved the problem, but the code used is not optimal OP then asks if somebody may give him a tip how to solve the same with a loop or similar. OP does not ask you to write the code, just provide a hint, as JouleV has done.
– Sveinung
yesterday
add a comment |
4
What have you tried so far? Anyway you are not a new user anymore
– JouleV
yesterday
2
@close-voters: The OP hasn't been online for 2 hours, i.e. he doesn't know what is going on yet. Give him some time.
– JouleV
yesterday
@JouleV Questions can also be reopened. In its current state it is unclear. Therefore voting to close.
– Henri Menke
yesterday
@HenriMenke The question is not unclear. OP informs us that he/she have solved the problem, but the code used is not optimal OP then asks if somebody may give him a tip how to solve the same with a loop or similar. OP does not ask you to write the code, just provide a hint, as JouleV has done.
– Sveinung
yesterday
4
4
What have you tried so far? Anyway you are not a new user anymore
– JouleV
yesterday
What have you tried so far? Anyway you are not a new user anymore
– JouleV
yesterday
2
2
@close-voters: The OP hasn't been online for 2 hours, i.e. he doesn't know what is going on yet. Give him some time.
– JouleV
yesterday
@close-voters: The OP hasn't been online for 2 hours, i.e. he doesn't know what is going on yet. Give him some time.
– JouleV
yesterday
@JouleV Questions can also be reopened. In its current state it is unclear. Therefore voting to close.
– Henri Menke
yesterday
@JouleV Questions can also be reopened. In its current state it is unclear. Therefore voting to close.
– Henri Menke
yesterday
@HenriMenke The question is not unclear. OP informs us that he/she have solved the problem, but the code used is not optimal OP then asks if somebody may give him a tip how to solve the same with a loop or similar. OP does not ask you to write the code, just provide a hint, as JouleV has done.
– Sveinung
yesterday
@HenriMenke The question is not unclear. OP informs us that he/she have solved the problem, but the code used is not optimal OP then asks if somebody may give him a tip how to solve the same with a loop or similar. OP does not ask you to write the code, just provide a hint, as JouleV has done.
– Sveinung
yesterday
add a comment |
1 Answer
1
active
oldest
votes
This does not provide a full code, but a hint so that you can shorten your code. You can use a pic for every group of dots like that.
documentclass[tikz]standalone
tikzset
dotcirc/.style=circle,inner sep=2pt,draw,fill=#1,
pics/tripdots/.style args=#1/#2-#3/#4-#5/#6,name=#7
code=
beginscope[local bounding box=#7]
draw (-1.2,0)--(1.2,0);
draw (0,0.2)--(0,-.2);
path (-1,0) node[dotcirc=#1] (#2) ;
path (0,0) node[dotcirc=#3] (#4) ;
path (1,0) node[dotcirc=#5] (#6) ;
endscope
begindocument
begintikzpicture
pic at (0,0) tripdots=red/ra-yellow/ya-green/ga,name=a;
draw[<-] (a) -- ++(.5,1) node[above] scalebox0.5Traffic lights;
draw[<-] (ra) -- ++ (.5,-1) node[below] scalebox0.5A colored circle;
endtikzpicture
enddocument

A good answer to the question. :)
– Sveinung
yesterday
Thanks a lot!. And a question, I have hear somethimes that "pic" use, but I don't know how it is, is that a package? I know I am not new at this but there are a lot of things I still don't know about tex.
– J.Rodriguez
yesterday
1
@J.Rodriguez You just have to read chapter 18 of the PGF manual.picis very useful - it is a syntax in TikZ, not a package.
– JouleV
yesterday
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%2f485713%2fhow-to-draw-this-diagram-graph-using-tikz%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This does not provide a full code, but a hint so that you can shorten your code. You can use a pic for every group of dots like that.
documentclass[tikz]standalone
tikzset
dotcirc/.style=circle,inner sep=2pt,draw,fill=#1,
pics/tripdots/.style args=#1/#2-#3/#4-#5/#6,name=#7
code=
beginscope[local bounding box=#7]
draw (-1.2,0)--(1.2,0);
draw (0,0.2)--(0,-.2);
path (-1,0) node[dotcirc=#1] (#2) ;
path (0,0) node[dotcirc=#3] (#4) ;
path (1,0) node[dotcirc=#5] (#6) ;
endscope
begindocument
begintikzpicture
pic at (0,0) tripdots=red/ra-yellow/ya-green/ga,name=a;
draw[<-] (a) -- ++(.5,1) node[above] scalebox0.5Traffic lights;
draw[<-] (ra) -- ++ (.5,-1) node[below] scalebox0.5A colored circle;
endtikzpicture
enddocument

A good answer to the question. :)
– Sveinung
yesterday
Thanks a lot!. And a question, I have hear somethimes that "pic" use, but I don't know how it is, is that a package? I know I am not new at this but there are a lot of things I still don't know about tex.
– J.Rodriguez
yesterday
1
@J.Rodriguez You just have to read chapter 18 of the PGF manual.picis very useful - it is a syntax in TikZ, not a package.
– JouleV
yesterday
add a comment |
This does not provide a full code, but a hint so that you can shorten your code. You can use a pic for every group of dots like that.
documentclass[tikz]standalone
tikzset
dotcirc/.style=circle,inner sep=2pt,draw,fill=#1,
pics/tripdots/.style args=#1/#2-#3/#4-#5/#6,name=#7
code=
beginscope[local bounding box=#7]
draw (-1.2,0)--(1.2,0);
draw (0,0.2)--(0,-.2);
path (-1,0) node[dotcirc=#1] (#2) ;
path (0,0) node[dotcirc=#3] (#4) ;
path (1,0) node[dotcirc=#5] (#6) ;
endscope
begindocument
begintikzpicture
pic at (0,0) tripdots=red/ra-yellow/ya-green/ga,name=a;
draw[<-] (a) -- ++(.5,1) node[above] scalebox0.5Traffic lights;
draw[<-] (ra) -- ++ (.5,-1) node[below] scalebox0.5A colored circle;
endtikzpicture
enddocument

A good answer to the question. :)
– Sveinung
yesterday
Thanks a lot!. And a question, I have hear somethimes that "pic" use, but I don't know how it is, is that a package? I know I am not new at this but there are a lot of things I still don't know about tex.
– J.Rodriguez
yesterday
1
@J.Rodriguez You just have to read chapter 18 of the PGF manual.picis very useful - it is a syntax in TikZ, not a package.
– JouleV
yesterday
add a comment |
This does not provide a full code, but a hint so that you can shorten your code. You can use a pic for every group of dots like that.
documentclass[tikz]standalone
tikzset
dotcirc/.style=circle,inner sep=2pt,draw,fill=#1,
pics/tripdots/.style args=#1/#2-#3/#4-#5/#6,name=#7
code=
beginscope[local bounding box=#7]
draw (-1.2,0)--(1.2,0);
draw (0,0.2)--(0,-.2);
path (-1,0) node[dotcirc=#1] (#2) ;
path (0,0) node[dotcirc=#3] (#4) ;
path (1,0) node[dotcirc=#5] (#6) ;
endscope
begindocument
begintikzpicture
pic at (0,0) tripdots=red/ra-yellow/ya-green/ga,name=a;
draw[<-] (a) -- ++(.5,1) node[above] scalebox0.5Traffic lights;
draw[<-] (ra) -- ++ (.5,-1) node[below] scalebox0.5A colored circle;
endtikzpicture
enddocument

This does not provide a full code, but a hint so that you can shorten your code. You can use a pic for every group of dots like that.
documentclass[tikz]standalone
tikzset
dotcirc/.style=circle,inner sep=2pt,draw,fill=#1,
pics/tripdots/.style args=#1/#2-#3/#4-#5/#6,name=#7
code=
beginscope[local bounding box=#7]
draw (-1.2,0)--(1.2,0);
draw (0,0.2)--(0,-.2);
path (-1,0) node[dotcirc=#1] (#2) ;
path (0,0) node[dotcirc=#3] (#4) ;
path (1,0) node[dotcirc=#5] (#6) ;
endscope
begindocument
begintikzpicture
pic at (0,0) tripdots=red/ra-yellow/ya-green/ga,name=a;
draw[<-] (a) -- ++(.5,1) node[above] scalebox0.5Traffic lights;
draw[<-] (ra) -- ++ (.5,-1) node[below] scalebox0.5A colored circle;
endtikzpicture
enddocument

edited yesterday
answered yesterday
JouleVJouleV
14.8k22666
14.8k22666
A good answer to the question. :)
– Sveinung
yesterday
Thanks a lot!. And a question, I have hear somethimes that "pic" use, but I don't know how it is, is that a package? I know I am not new at this but there are a lot of things I still don't know about tex.
– J.Rodriguez
yesterday
1
@J.Rodriguez You just have to read chapter 18 of the PGF manual.picis very useful - it is a syntax in TikZ, not a package.
– JouleV
yesterday
add a comment |
A good answer to the question. :)
– Sveinung
yesterday
Thanks a lot!. And a question, I have hear somethimes that "pic" use, but I don't know how it is, is that a package? I know I am not new at this but there are a lot of things I still don't know about tex.
– J.Rodriguez
yesterday
1
@J.Rodriguez You just have to read chapter 18 of the PGF manual.picis very useful - it is a syntax in TikZ, not a package.
– JouleV
yesterday
A good answer to the question. :)
– Sveinung
yesterday
A good answer to the question. :)
– Sveinung
yesterday
Thanks a lot!. And a question, I have hear somethimes that "pic" use, but I don't know how it is, is that a package? I know I am not new at this but there are a lot of things I still don't know about tex.
– J.Rodriguez
yesterday
Thanks a lot!. And a question, I have hear somethimes that "pic" use, but I don't know how it is, is that a package? I know I am not new at this but there are a lot of things I still don't know about tex.
– J.Rodriguez
yesterday
1
1
@J.Rodriguez You just have to read chapter 18 of the PGF manual.
pic is very useful - it is a syntax in TikZ, not a package.– JouleV
yesterday
@J.Rodriguez You just have to read chapter 18 of the PGF manual.
pic is very useful - it is a syntax in TikZ, not a package.– JouleV
yesterday
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%2f485713%2fhow-to-draw-this-diagram-graph-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
4
What have you tried so far? Anyway you are not a new user anymore
– JouleV
yesterday
2
@close-voters: The OP hasn't been online for 2 hours, i.e. he doesn't know what is going on yet. Give him some time.
– JouleV
yesterday
@JouleV Questions can also be reopened. In its current state it is unclear. Therefore voting to close.
– Henri Menke
yesterday
@HenriMenke The question is not unclear. OP informs us that he/she have solved the problem, but the code used is not optimal OP then asks if somebody may give him a tip how to solve the same with a loop or similar. OP does not ask you to write the code, just provide a hint, as JouleV has done.
– Sveinung
yesterday