simplifying foreach to repeat a drawing
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I use the following code to repeat a drawing. Can it be simplified.
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,4.25
draw<2> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<3,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in .75
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
endtikzpicture
endframe
enddocument
tikz-pgf
add a comment |Â
up vote
1
down vote
favorite
I use the following code to repeat a drawing. Can it be simplified.
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,4.25
draw<2> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<3,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in .75
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
endtikzpicture
endframe
enddocument
tikz-pgf
2
Maybe you should think about using decorated paths (with dot-like markers), but then you would not need to draw every circle, only the "paths".
â TeXnician
41 mins ago
Thank you. Can you please post your suggested code. I do not know how to do it.
â Hany
35 mins ago
Unfortunately, I do not have that much experience in markers, but that's what a manual is for.
â TeXnician
27 mins ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I use the following code to repeat a drawing. Can it be simplified.
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,4.25
draw<2> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<3,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in .75
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
endtikzpicture
endframe
enddocument
tikz-pgf
I use the following code to repeat a drawing. Can it be simplified.
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,4.25
draw<2> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<3,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in .75
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75
draw<2,3> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
foreach x in 4.25
draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25
draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6];
endtikzpicture
vspace -.18cm
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5];
endtikzpicture
endframe
enddocument
tikz-pgf
tikz-pgf
asked 48 mins ago
Hany
729314
729314
2
Maybe you should think about using decorated paths (with dot-like markers), but then you would not need to draw every circle, only the "paths".
â TeXnician
41 mins ago
Thank you. Can you please post your suggested code. I do not know how to do it.
â Hany
35 mins ago
Unfortunately, I do not have that much experience in markers, but that's what a manual is for.
â TeXnician
27 mins ago
add a comment |Â
2
Maybe you should think about using decorated paths (with dot-like markers), but then you would not need to draw every circle, only the "paths".
â TeXnician
41 mins ago
Thank you. Can you please post your suggested code. I do not know how to do it.
â Hany
35 mins ago
Unfortunately, I do not have that much experience in markers, but that's what a manual is for.
â TeXnician
27 mins ago
2
2
Maybe you should think about using decorated paths (with dot-like markers), but then you would not need to draw every circle, only the "paths".
â TeXnician
41 mins ago
Maybe you should think about using decorated paths (with dot-like markers), but then you would not need to draw every circle, only the "paths".
â TeXnician
41 mins ago
Thank you. Can you please post your suggested code. I do not know how to do it.
â Hany
35 mins ago
Thank you. Can you please post your suggested code. I do not know how to do it.
â Hany
35 mins ago
Unfortunately, I do not have that much experience in markers, but that's what a manual is for.
â TeXnician
27 mins ago
Unfortunately, I do not have that much experience in markers, but that's what a manual is for.
â TeXnician
27 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
Very simple suggestion: use only one TikZpicture and only draw what is needed accounting the duplication of some nodes in the different stages.
documentclass[svgnames]beamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
foreach y in 0,.25,.5,.75,1,...,4
fill[draw=brown, fill=yellow] (x,-y) circle (3pt);
only<2-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-.25) circle (3pt);
fill[draw=DarkGreen, fill=green] (x,-3.75) circle (3pt);
only<2,4>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (.75,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (4.25,y) circle (3pt);
only<2-3>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (4.25,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (.75,y) circle (3pt);
only<3-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-2) circle (3pt);
endtikzpicture
endframe
enddocument
Thank you very much. Just one enquiry. What is [svgnames] used for?
â Hany
21 mins ago
@HanyDarkGreen
.
â TeXnician
17 mins ago
Thank you for your time and effort.
â Hany
16 mins ago
add a comment |Â
up vote
3
down vote
You can cheat:
- Fill a rectangle.
- Draw the path.
- Fill everything but the rectangles white.
Code:
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitleSome dotted path
only<1>Fill a rectangle
only<2>Draw the path
only<3>Fill everything but the circles white
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
pause
draw[line width=7pt,green!40!black] (3*8pt,1*8pt) rectangle (22*8pt,24*8pt);
pause
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture[xscale=-1]
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
enddocument
Result:
Thank you very much. How to draw the other figures (2) and (5)?
â Hany
17 mins ago
That's a great idea :)
â TeXnician
17 mins ago
@Hany I added them. I guess this method becomes more advantageous the more complex the curve is.
â marmot
10 mins ago
Thank you very much.
â Hany
4 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
Very simple suggestion: use only one TikZpicture and only draw what is needed accounting the duplication of some nodes in the different stages.
documentclass[svgnames]beamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
foreach y in 0,.25,.5,.75,1,...,4
fill[draw=brown, fill=yellow] (x,-y) circle (3pt);
only<2-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-.25) circle (3pt);
fill[draw=DarkGreen, fill=green] (x,-3.75) circle (3pt);
only<2,4>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (.75,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (4.25,y) circle (3pt);
only<2-3>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (4.25,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (.75,y) circle (3pt);
only<3-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-2) circle (3pt);
endtikzpicture
endframe
enddocument
Thank you very much. Just one enquiry. What is [svgnames] used for?
â Hany
21 mins ago
@HanyDarkGreen
.
â TeXnician
17 mins ago
Thank you for your time and effort.
â Hany
16 mins ago
add a comment |Â
up vote
4
down vote
accepted
Very simple suggestion: use only one TikZpicture and only draw what is needed accounting the duplication of some nodes in the different stages.
documentclass[svgnames]beamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
foreach y in 0,.25,.5,.75,1,...,4
fill[draw=brown, fill=yellow] (x,-y) circle (3pt);
only<2-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-.25) circle (3pt);
fill[draw=DarkGreen, fill=green] (x,-3.75) circle (3pt);
only<2,4>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (.75,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (4.25,y) circle (3pt);
only<2-3>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (4.25,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (.75,y) circle (3pt);
only<3-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-2) circle (3pt);
endtikzpicture
endframe
enddocument
Thank you very much. Just one enquiry. What is [svgnames] used for?
â Hany
21 mins ago
@HanyDarkGreen
.
â TeXnician
17 mins ago
Thank you for your time and effort.
â Hany
16 mins ago
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
Very simple suggestion: use only one TikZpicture and only draw what is needed accounting the duplication of some nodes in the different stages.
documentclass[svgnames]beamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
foreach y in 0,.25,.5,.75,1,...,4
fill[draw=brown, fill=yellow] (x,-y) circle (3pt);
only<2-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-.25) circle (3pt);
fill[draw=DarkGreen, fill=green] (x,-3.75) circle (3pt);
only<2,4>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (.75,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (4.25,y) circle (3pt);
only<2-3>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (4.25,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (.75,y) circle (3pt);
only<3-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-2) circle (3pt);
endtikzpicture
endframe
enddocument
Very simple suggestion: use only one TikZpicture and only draw what is needed accounting the duplication of some nodes in the different stages.
documentclass[svgnames]beamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitle
begintikzpicture
foreach x in 0,.25,.5,.75,1,...,5
foreach y in 0,.25,.5,.75,1,...,4
fill[draw=brown, fill=yellow] (x,-y) circle (3pt);
only<2-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-.25) circle (3pt);
fill[draw=DarkGreen, fill=green] (x,-3.75) circle (3pt);
only<2,4>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (.75,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (4.25,y) circle (3pt);
only<2-3>
foreach x in -.5,-.75,-1,...,-2
pgfmathsetmacroyx-1.75
fill[draw=DarkGreen, fill=green] (4.25,x) circle (3pt);
fill[draw=DarkGreen, fill=green] (.75,y) circle (3pt);
only<3-4>
foreach x in .75,1,1.25,...,4.25
fill[draw=DarkGreen, fill=green] (x,-2) circle (3pt);
endtikzpicture
endframe
enddocument
answered 27 mins ago
TeXnician
21.7k52882
21.7k52882
Thank you very much. Just one enquiry. What is [svgnames] used for?
â Hany
21 mins ago
@HanyDarkGreen
.
â TeXnician
17 mins ago
Thank you for your time and effort.
â Hany
16 mins ago
add a comment |Â
Thank you very much. Just one enquiry. What is [svgnames] used for?
â Hany
21 mins ago
@HanyDarkGreen
.
â TeXnician
17 mins ago
Thank you for your time and effort.
â Hany
16 mins ago
Thank you very much. Just one enquiry. What is [svgnames] used for?
â Hany
21 mins ago
Thank you very much. Just one enquiry. What is [svgnames] used for?
â Hany
21 mins ago
@Hany
DarkGreen
.â TeXnician
17 mins ago
@Hany
DarkGreen
.â TeXnician
17 mins ago
Thank you for your time and effort.
â Hany
16 mins ago
Thank you for your time and effort.
â Hany
16 mins ago
add a comment |Â
up vote
3
down vote
You can cheat:
- Fill a rectangle.
- Draw the path.
- Fill everything but the rectangles white.
Code:
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitleSome dotted path
only<1>Fill a rectangle
only<2>Draw the path
only<3>Fill everything but the circles white
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
pause
draw[line width=7pt,green!40!black] (3*8pt,1*8pt) rectangle (22*8pt,24*8pt);
pause
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture[xscale=-1]
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
enddocument
Result:
Thank you very much. How to draw the other figures (2) and (5)?
â Hany
17 mins ago
That's a great idea :)
â TeXnician
17 mins ago
@Hany I added them. I guess this method becomes more advantageous the more complex the curve is.
â marmot
10 mins ago
Thank you very much.
â Hany
4 mins ago
add a comment |Â
up vote
3
down vote
You can cheat:
- Fill a rectangle.
- Draw the path.
- Fill everything but the rectangles white.
Code:
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitleSome dotted path
only<1>Fill a rectangle
only<2>Draw the path
only<3>Fill everything but the circles white
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
pause
draw[line width=7pt,green!40!black] (3*8pt,1*8pt) rectangle (22*8pt,24*8pt);
pause
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture[xscale=-1]
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
enddocument
Result:
Thank you very much. How to draw the other figures (2) and (5)?
â Hany
17 mins ago
That's a great idea :)
â TeXnician
17 mins ago
@Hany I added them. I guess this method becomes more advantageous the more complex the curve is.
â marmot
10 mins ago
Thank you very much.
â Hany
4 mins ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
You can cheat:
- Fill a rectangle.
- Draw the path.
- Fill everything but the rectangles white.
Code:
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitleSome dotted path
only<1>Fill a rectangle
only<2>Draw the path
only<3>Fill everything but the circles white
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
pause
draw[line width=7pt,green!40!black] (3*8pt,1*8pt) rectangle (22*8pt,24*8pt);
pause
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture[xscale=-1]
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
enddocument
Result:
You can cheat:
- Fill a rectangle.
- Draw the path.
- Fill everything but the rectangles white.
Code:
documentclassbeamer
setbeamertemplatenavigation symbols
usepackagetikz
begindocument
beginframe[fragile,t]
frametitleSome dotted path
only<1>Fill a rectangle
only<2>Draw the path
only<3>Fill everything but the circles white
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
pause
draw[line width=7pt,green!40!black] (3*8pt,1*8pt) rectangle (22*8pt,24*8pt);
pause
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
beginframe[fragile,t]
frametitleSome dotted path (cont'd)
begintikzpicture[xscale=-1]
clip (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
fill[yellow] (-4pt,-4pt) rectangle (25.5*8pt,25.5*8pt);
draw[line width=7pt,green!40!black,line cap=round] (3*8pt,24*8pt)
-- (22*8pt,24*8pt) -- (22*8pt,13*8pt)
-- (3*8pt,13*8pt) -- (3*8pt,1*8pt) -- (22*8pt,1*8pt);
draw[brown,fill=white,even odd rule]
(-5pt,-5pt) rectangle (25.5*8pt+1pt,25.5*8pt+1pt)
foreach X in 0,...,25
foreach Y in 0,...,25
(X*8pt,Y*8pt) circle (3.5pt)
;
endtikzpicture
endframe
enddocument
Result:
edited 11 mins ago
answered 23 mins ago
marmot
60.1k464129
60.1k464129
Thank you very much. How to draw the other figures (2) and (5)?
â Hany
17 mins ago
That's a great idea :)
â TeXnician
17 mins ago
@Hany I added them. I guess this method becomes more advantageous the more complex the curve is.
â marmot
10 mins ago
Thank you very much.
â Hany
4 mins ago
add a comment |Â
Thank you very much. How to draw the other figures (2) and (5)?
â Hany
17 mins ago
That's a great idea :)
â TeXnician
17 mins ago
@Hany I added them. I guess this method becomes more advantageous the more complex the curve is.
â marmot
10 mins ago
Thank you very much.
â Hany
4 mins ago
Thank you very much. How to draw the other figures (2) and (5)?
â Hany
17 mins ago
Thank you very much. How to draw the other figures (2) and (5)?
â Hany
17 mins ago
That's a great idea :)
â TeXnician
17 mins ago
That's a great idea :)
â TeXnician
17 mins ago
@Hany I added them. I guess this method becomes more advantageous the more complex the curve is.
â marmot
10 mins ago
@Hany I added them. I guess this method becomes more advantageous the more complex the curve is.
â marmot
10 mins ago
Thank you very much.
â Hany
4 mins ago
Thank you very much.
â Hany
4 mins ago
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f452369%2fsimplifying-foreach-to-repeat-a-drawing%23new-answer', 'question_page');
);
Post as a guest
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
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
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
2
Maybe you should think about using decorated paths (with dot-like markers), but then you would not need to draw every circle, only the "paths".
â TeXnician
41 mins ago
Thank you. Can you please post your suggested code. I do not know how to do it.
â Hany
35 mins ago
Unfortunately, I do not have that much experience in markers, but that's what a manual is for.
â TeXnician
27 mins ago