Drawing a circle with nodes shift with TikzHow do I place nodes around a circle in Tikz?Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Flowchart: adding label in top of pictureNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionNode position based on two nodesDraw nodes with path in tikzDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themUsing tikz Calc package to add cordinates

Arithmetics in LuaLaTeX

Operation Unzalgo

Why a binary file is not shown as 0 and 1?

Difference between Pure EdDSA (ed25519) and HashEdDSA (ed25519ph)

Why did Fury respond that way?

How do you give a date interval with diffuse dates?

Why teach C using scanf without talking about command line arguments?

An entire function all whose forward orbits are bounded

In this iconic lunar orbit rendezvous photo of John Houbolt, why do arrows #5 and #6 point the "wrong" way?

Why does a tetrahedral molecule like methane have a dipole moment of zero?

What was the difference between a Games Console and a Home Computer?

Is Error correction and detection can be done with out adding extra bits?

Why can't I hear fret buzz through the amp?

How would thermophilic fish survive?

How can I help our ranger feel special about her beast companion?

How to tell the object type of an Attachment

"Je suis petite, moi?", purpose of the "moi"?

Which modern firearm should a time traveler bring to be easily reproducible for a historic civilization?

What happens if a company buys back all of its shares?

How to find location on Cambridge-Mildenhall railway that still has tracks/rails?

Why were these characters absent in Spider-Man: Far From Home?

How did Jayne know when to shoot?

What would be the safest way to drop thousands of small, hard objects from a typical, high wing, GA airplane?

How can electric field be defined as force per charge, if the charge makes its own, singular electric field?



Drawing a circle with nodes shift with Tikz


How do I place nodes around a circle in Tikz?Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Flowchart: adding label in top of pictureNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionNode position based on two nodesDraw nodes with path in tikzDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themUsing tikz Calc package to add cordinates






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I am newby in Tikz and want to draw a circle with on it 16 circle-shaped nodes.
Each slide increment would shift to the next node rightward or leftward ( an example with both should be fine), while highlighting it (the highlight should be about the current position/node).
Anybody could help me achieving this ?
An example of the drawing is attached :



enter image description here



Thank you



EDIT : This is a good start but i need circle shaped nodes not text with one node each time hightlighted (colored with blue) (the current position) and node shift could be right or left :



documentclassreport
usepackagetikz,calc

begindocument
begintikzpicture
foreach a in 1,2,...,17
draw (a*360/17: 4cm) nodeangle a;

endtikzpicture
enddocument









share|improve this question









New contributor



user1319236 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Welcome to TeX.SX! With what part are you having problems with? What have you tried so far? Also see this question which is similar.

    – siracusa
    8 hours ago











  • Thx pls see edit i need to move to the next or previous node on increment slide button

    – user1319236
    8 hours ago


















3















I am newby in Tikz and want to draw a circle with on it 16 circle-shaped nodes.
Each slide increment would shift to the next node rightward or leftward ( an example with both should be fine), while highlighting it (the highlight should be about the current position/node).
Anybody could help me achieving this ?
An example of the drawing is attached :



enter image description here



Thank you



EDIT : This is a good start but i need circle shaped nodes not text with one node each time hightlighted (colored with blue) (the current position) and node shift could be right or left :



documentclassreport
usepackagetikz,calc

begindocument
begintikzpicture
foreach a in 1,2,...,17
draw (a*360/17: 4cm) nodeangle a;

endtikzpicture
enddocument









share|improve this question









New contributor



user1319236 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Welcome to TeX.SX! With what part are you having problems with? What have you tried so far? Also see this question which is similar.

    – siracusa
    8 hours ago











  • Thx pls see edit i need to move to the next or previous node on increment slide button

    – user1319236
    8 hours ago














3












3








3


1






I am newby in Tikz and want to draw a circle with on it 16 circle-shaped nodes.
Each slide increment would shift to the next node rightward or leftward ( an example with both should be fine), while highlighting it (the highlight should be about the current position/node).
Anybody could help me achieving this ?
An example of the drawing is attached :



enter image description here



Thank you



EDIT : This is a good start but i need circle shaped nodes not text with one node each time hightlighted (colored with blue) (the current position) and node shift could be right or left :



documentclassreport
usepackagetikz,calc

begindocument
begintikzpicture
foreach a in 1,2,...,17
draw (a*360/17: 4cm) nodeangle a;

endtikzpicture
enddocument









share|improve this question









New contributor



user1319236 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I am newby in Tikz and want to draw a circle with on it 16 circle-shaped nodes.
Each slide increment would shift to the next node rightward or leftward ( an example with both should be fine), while highlighting it (the highlight should be about the current position/node).
Anybody could help me achieving this ?
An example of the drawing is attached :



enter image description here



Thank you



EDIT : This is a good start but i need circle shaped nodes not text with one node each time hightlighted (colored with blue) (the current position) and node shift could be right or left :



documentclassreport
usepackagetikz,calc

begindocument
begintikzpicture
foreach a in 1,2,...,17
draw (a*360/17: 4cm) nodeangle a;

endtikzpicture
enddocument






tikz-pgf beamer






share|improve this question









New contributor



user1319236 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



user1319236 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited 8 hours ago







user1319236













New contributor



user1319236 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked 8 hours ago









user1319236user1319236

183 bronze badges




183 bronze badges




New contributor



user1319236 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




user1319236 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • Welcome to TeX.SX! With what part are you having problems with? What have you tried so far? Also see this question which is similar.

    – siracusa
    8 hours ago











  • Thx pls see edit i need to move to the next or previous node on increment slide button

    – user1319236
    8 hours ago


















  • Welcome to TeX.SX! With what part are you having problems with? What have you tried so far? Also see this question which is similar.

    – siracusa
    8 hours ago











  • Thx pls see edit i need to move to the next or previous node on increment slide button

    – user1319236
    8 hours ago

















Welcome to TeX.SX! With what part are you having problems with? What have you tried so far? Also see this question which is similar.

– siracusa
8 hours ago





Welcome to TeX.SX! With what part are you having problems with? What have you tried so far? Also see this question which is similar.

– siracusa
8 hours ago













Thx pls see edit i need to move to the next or previous node on increment slide button

– user1319236
8 hours ago






Thx pls see edit i need to move to the next or previous node on increment slide button

– user1319236
8 hours ago











2 Answers
2






active

oldest

votes


















5














I think something like this is what you're after.



documentclassbeamer
usepackagetikz
% define a counter
newcountCircNum
% macro to hold a color name
newcommandClrblack
begindocument
beginframe
% set up an animation, CircNum changes from 1 to 17
% with each frame
animatevalue<1-17>CircNum117
begintikzpicture
% draw the main circle
node [circle, draw, minimum size=8cm] (c) ;

foreach a in 1,2,...,17
% if a is equal to CircNum, set the color to blue
% otherwise set it to black
ifnuma=theCircNum
renewcommandClrblue
else
renewcommandClrblack
fi
% make a new node for the small circles
node[Clr, % with the color defined by the macro
draw, thick, % draw the outline
fill, % fill it
minimum size=5mm, % set the size
circle, % circular shape
label=[Clr]a*360/17+180:a % add the number on the inside
] at (c.a*360/17) % position it on the edge of the main circle
;

endtikzpicture
endframe
enddocument


Here are the first three slides of the PDF:



enter image description here






share|improve this answer

























  • Thx its almost that except the current position / node should be all colored not just the periphery

    – user1319236
    6 hours ago











  • @user1319236 Just add fill to the node options for the node in the foreach loop.

    – Torbjørn T.
    6 hours ago











  • Yep you got it right thx

    – user1319236
    6 hours ago


















2














Welcome to TeX.SE!



Here is a solution that borrows int_step_variable:nnnNn from expl3:



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The small circles and their labels
intstepvariable01nsteps - 1i% initstepfinalvariable
pgfmathsetmacroangle90 - i*360/nsteps
pgfmathsetmacroothersideangle+180
pgfmathsetmacroiplusoneint(i+1)
pgfmathsetmacroiplustwoint(i+2)

uncover<iplustwo->
node[circle, draw, minimum width=2*smallcirclewidth,
label=otherside:iplusone] at (C.angle) ;

uncover<iplustwo> % fill one small circle per frame
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11



Note: as an alternative to the following code:



pgfmathsetmacroiplustwoint(i+2)

(...)

uncover<iplustwo-> (...)
uncover<iplustwo> (...)


one could use, assuming e-TeX extensions are available:



uncover<thenumexpr i+2relax-> (...) 
uncover<thenumexpr i+2relax> (...)


Now, let's redo the same beamer presentation, but using a more straightforward order (small circles at angles 1*360/10, 2*360/10, ..., 10*360/10 degrees, respectively). The main code is written in a (slightly) different way from the previous example: it uses two loops and the pause macro from beamer, whereas the first example did everything in one loop, and used only uncover.



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The filled circles: highlight a single small circle on each frame starting
% from frame 2.
intstepvariable21nsteps+1i% initstepfinalvariable
pgfmathsetmacroangle(i-1)*360/nsteps
uncover<i>
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



% The unfilled circles and their labels
intstepvariable11nstepsi% initstepfinalvariable
pgfmathsetmacroanglei*360/nsteps
pgfmathsetmacroothersideangle+180

pause
node[circle, draw, minimum width=2*smallcirclewidth, label=otherside:i]
at (C.angle) ;


endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11






share|improve this answer

























  • Thx for the answer maybe next time i use this in another project but for now i'm going to go with the solution not requiring additional package setup like the usepackageexpl3

    – user1319236
    6 hours ago











  • +1, but I would have expected an l3draw circle :D

    – TeXnician
    4 hours ago











  • @TeXnician Thanks! Regarding l3draw, I believe its edges are still a bit rough for me. :-p

    – frougon
    4 hours ago













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
);



);






user1319236 is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f500521%2fdrawing-a-circle-with-nodes-shift-with-tikz%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














I think something like this is what you're after.



documentclassbeamer
usepackagetikz
% define a counter
newcountCircNum
% macro to hold a color name
newcommandClrblack
begindocument
beginframe
% set up an animation, CircNum changes from 1 to 17
% with each frame
animatevalue<1-17>CircNum117
begintikzpicture
% draw the main circle
node [circle, draw, minimum size=8cm] (c) ;

foreach a in 1,2,...,17
% if a is equal to CircNum, set the color to blue
% otherwise set it to black
ifnuma=theCircNum
renewcommandClrblue
else
renewcommandClrblack
fi
% make a new node for the small circles
node[Clr, % with the color defined by the macro
draw, thick, % draw the outline
fill, % fill it
minimum size=5mm, % set the size
circle, % circular shape
label=[Clr]a*360/17+180:a % add the number on the inside
] at (c.a*360/17) % position it on the edge of the main circle
;

endtikzpicture
endframe
enddocument


Here are the first three slides of the PDF:



enter image description here






share|improve this answer

























  • Thx its almost that except the current position / node should be all colored not just the periphery

    – user1319236
    6 hours ago











  • @user1319236 Just add fill to the node options for the node in the foreach loop.

    – Torbjørn T.
    6 hours ago











  • Yep you got it right thx

    – user1319236
    6 hours ago















5














I think something like this is what you're after.



documentclassbeamer
usepackagetikz
% define a counter
newcountCircNum
% macro to hold a color name
newcommandClrblack
begindocument
beginframe
% set up an animation, CircNum changes from 1 to 17
% with each frame
animatevalue<1-17>CircNum117
begintikzpicture
% draw the main circle
node [circle, draw, minimum size=8cm] (c) ;

foreach a in 1,2,...,17
% if a is equal to CircNum, set the color to blue
% otherwise set it to black
ifnuma=theCircNum
renewcommandClrblue
else
renewcommandClrblack
fi
% make a new node for the small circles
node[Clr, % with the color defined by the macro
draw, thick, % draw the outline
fill, % fill it
minimum size=5mm, % set the size
circle, % circular shape
label=[Clr]a*360/17+180:a % add the number on the inside
] at (c.a*360/17) % position it on the edge of the main circle
;

endtikzpicture
endframe
enddocument


Here are the first three slides of the PDF:



enter image description here






share|improve this answer

























  • Thx its almost that except the current position / node should be all colored not just the periphery

    – user1319236
    6 hours ago











  • @user1319236 Just add fill to the node options for the node in the foreach loop.

    – Torbjørn T.
    6 hours ago











  • Yep you got it right thx

    – user1319236
    6 hours ago













5












5








5







I think something like this is what you're after.



documentclassbeamer
usepackagetikz
% define a counter
newcountCircNum
% macro to hold a color name
newcommandClrblack
begindocument
beginframe
% set up an animation, CircNum changes from 1 to 17
% with each frame
animatevalue<1-17>CircNum117
begintikzpicture
% draw the main circle
node [circle, draw, minimum size=8cm] (c) ;

foreach a in 1,2,...,17
% if a is equal to CircNum, set the color to blue
% otherwise set it to black
ifnuma=theCircNum
renewcommandClrblue
else
renewcommandClrblack
fi
% make a new node for the small circles
node[Clr, % with the color defined by the macro
draw, thick, % draw the outline
fill, % fill it
minimum size=5mm, % set the size
circle, % circular shape
label=[Clr]a*360/17+180:a % add the number on the inside
] at (c.a*360/17) % position it on the edge of the main circle
;

endtikzpicture
endframe
enddocument


Here are the first three slides of the PDF:



enter image description here






share|improve this answer















I think something like this is what you're after.



documentclassbeamer
usepackagetikz
% define a counter
newcountCircNum
% macro to hold a color name
newcommandClrblack
begindocument
beginframe
% set up an animation, CircNum changes from 1 to 17
% with each frame
animatevalue<1-17>CircNum117
begintikzpicture
% draw the main circle
node [circle, draw, minimum size=8cm] (c) ;

foreach a in 1,2,...,17
% if a is equal to CircNum, set the color to blue
% otherwise set it to black
ifnuma=theCircNum
renewcommandClrblue
else
renewcommandClrblack
fi
% make a new node for the small circles
node[Clr, % with the color defined by the macro
draw, thick, % draw the outline
fill, % fill it
minimum size=5mm, % set the size
circle, % circular shape
label=[Clr]a*360/17+180:a % add the number on the inside
] at (c.a*360/17) % position it on the edge of the main circle
;

endtikzpicture
endframe
enddocument


Here are the first three slides of the PDF:



enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 6 hours ago

























answered 7 hours ago









Torbjørn T.Torbjørn T.

162k13 gold badges266 silver badges453 bronze badges




162k13 gold badges266 silver badges453 bronze badges












  • Thx its almost that except the current position / node should be all colored not just the periphery

    – user1319236
    6 hours ago











  • @user1319236 Just add fill to the node options for the node in the foreach loop.

    – Torbjørn T.
    6 hours ago











  • Yep you got it right thx

    – user1319236
    6 hours ago

















  • Thx its almost that except the current position / node should be all colored not just the periphery

    – user1319236
    6 hours ago











  • @user1319236 Just add fill to the node options for the node in the foreach loop.

    – Torbjørn T.
    6 hours ago











  • Yep you got it right thx

    – user1319236
    6 hours ago
















Thx its almost that except the current position / node should be all colored not just the periphery

– user1319236
6 hours ago





Thx its almost that except the current position / node should be all colored not just the periphery

– user1319236
6 hours ago













@user1319236 Just add fill to the node options for the node in the foreach loop.

– Torbjørn T.
6 hours ago





@user1319236 Just add fill to the node options for the node in the foreach loop.

– Torbjørn T.
6 hours ago













Yep you got it right thx

– user1319236
6 hours ago





Yep you got it right thx

– user1319236
6 hours ago













2














Welcome to TeX.SE!



Here is a solution that borrows int_step_variable:nnnNn from expl3:



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The small circles and their labels
intstepvariable01nsteps - 1i% initstepfinalvariable
pgfmathsetmacroangle90 - i*360/nsteps
pgfmathsetmacroothersideangle+180
pgfmathsetmacroiplusoneint(i+1)
pgfmathsetmacroiplustwoint(i+2)

uncover<iplustwo->
node[circle, draw, minimum width=2*smallcirclewidth,
label=otherside:iplusone] at (C.angle) ;

uncover<iplustwo> % fill one small circle per frame
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11



Note: as an alternative to the following code:



pgfmathsetmacroiplustwoint(i+2)

(...)

uncover<iplustwo-> (...)
uncover<iplustwo> (...)


one could use, assuming e-TeX extensions are available:



uncover<thenumexpr i+2relax-> (...) 
uncover<thenumexpr i+2relax> (...)


Now, let's redo the same beamer presentation, but using a more straightforward order (small circles at angles 1*360/10, 2*360/10, ..., 10*360/10 degrees, respectively). The main code is written in a (slightly) different way from the previous example: it uses two loops and the pause macro from beamer, whereas the first example did everything in one loop, and used only uncover.



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The filled circles: highlight a single small circle on each frame starting
% from frame 2.
intstepvariable21nsteps+1i% initstepfinalvariable
pgfmathsetmacroangle(i-1)*360/nsteps
uncover<i>
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



% The unfilled circles and their labels
intstepvariable11nstepsi% initstepfinalvariable
pgfmathsetmacroanglei*360/nsteps
pgfmathsetmacroothersideangle+180

pause
node[circle, draw, minimum width=2*smallcirclewidth, label=otherside:i]
at (C.angle) ;


endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11






share|improve this answer

























  • Thx for the answer maybe next time i use this in another project but for now i'm going to go with the solution not requiring additional package setup like the usepackageexpl3

    – user1319236
    6 hours ago











  • +1, but I would have expected an l3draw circle :D

    – TeXnician
    4 hours ago











  • @TeXnician Thanks! Regarding l3draw, I believe its edges are still a bit rough for me. :-p

    – frougon
    4 hours ago















2














Welcome to TeX.SE!



Here is a solution that borrows int_step_variable:nnnNn from expl3:



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The small circles and their labels
intstepvariable01nsteps - 1i% initstepfinalvariable
pgfmathsetmacroangle90 - i*360/nsteps
pgfmathsetmacroothersideangle+180
pgfmathsetmacroiplusoneint(i+1)
pgfmathsetmacroiplustwoint(i+2)

uncover<iplustwo->
node[circle, draw, minimum width=2*smallcirclewidth,
label=otherside:iplusone] at (C.angle) ;

uncover<iplustwo> % fill one small circle per frame
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11



Note: as an alternative to the following code:



pgfmathsetmacroiplustwoint(i+2)

(...)

uncover<iplustwo-> (...)
uncover<iplustwo> (...)


one could use, assuming e-TeX extensions are available:



uncover<thenumexpr i+2relax-> (...) 
uncover<thenumexpr i+2relax> (...)


Now, let's redo the same beamer presentation, but using a more straightforward order (small circles at angles 1*360/10, 2*360/10, ..., 10*360/10 degrees, respectively). The main code is written in a (slightly) different way from the previous example: it uses two loops and the pause macro from beamer, whereas the first example did everything in one loop, and used only uncover.



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The filled circles: highlight a single small circle on each frame starting
% from frame 2.
intstepvariable21nsteps+1i% initstepfinalvariable
pgfmathsetmacroangle(i-1)*360/nsteps
uncover<i>
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



% The unfilled circles and their labels
intstepvariable11nstepsi% initstepfinalvariable
pgfmathsetmacroanglei*360/nsteps
pgfmathsetmacroothersideangle+180

pause
node[circle, draw, minimum width=2*smallcirclewidth, label=otherside:i]
at (C.angle) ;


endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11






share|improve this answer

























  • Thx for the answer maybe next time i use this in another project but for now i'm going to go with the solution not requiring additional package setup like the usepackageexpl3

    – user1319236
    6 hours ago











  • +1, but I would have expected an l3draw circle :D

    – TeXnician
    4 hours ago











  • @TeXnician Thanks! Regarding l3draw, I believe its edges are still a bit rough for me. :-p

    – frougon
    4 hours ago













2












2








2







Welcome to TeX.SE!



Here is a solution that borrows int_step_variable:nnnNn from expl3:



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The small circles and their labels
intstepvariable01nsteps - 1i% initstepfinalvariable
pgfmathsetmacroangle90 - i*360/nsteps
pgfmathsetmacroothersideangle+180
pgfmathsetmacroiplusoneint(i+1)
pgfmathsetmacroiplustwoint(i+2)

uncover<iplustwo->
node[circle, draw, minimum width=2*smallcirclewidth,
label=otherside:iplusone] at (C.angle) ;

uncover<iplustwo> % fill one small circle per frame
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11



Note: as an alternative to the following code:



pgfmathsetmacroiplustwoint(i+2)

(...)

uncover<iplustwo-> (...)
uncover<iplustwo> (...)


one could use, assuming e-TeX extensions are available:



uncover<thenumexpr i+2relax-> (...) 
uncover<thenumexpr i+2relax> (...)


Now, let's redo the same beamer presentation, but using a more straightforward order (small circles at angles 1*360/10, 2*360/10, ..., 10*360/10 degrees, respectively). The main code is written in a (slightly) different way from the previous example: it uses two loops and the pause macro from beamer, whereas the first example did everything in one loop, and used only uncover.



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The filled circles: highlight a single small circle on each frame starting
% from frame 2.
intstepvariable21nsteps+1i% initstepfinalvariable
pgfmathsetmacroangle(i-1)*360/nsteps
uncover<i>
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



% The unfilled circles and their labels
intstepvariable11nstepsi% initstepfinalvariable
pgfmathsetmacroanglei*360/nsteps
pgfmathsetmacroothersideangle+180

pause
node[circle, draw, minimum width=2*smallcirclewidth, label=otherside:i]
at (C.angle) ;


endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11






share|improve this answer















Welcome to TeX.SE!



Here is a solution that borrows int_step_variable:nnnNn from expl3:



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The small circles and their labels
intstepvariable01nsteps - 1i% initstepfinalvariable
pgfmathsetmacroangle90 - i*360/nsteps
pgfmathsetmacroothersideangle+180
pgfmathsetmacroiplusoneint(i+1)
pgfmathsetmacroiplustwoint(i+2)

uncover<iplustwo->
node[circle, draw, minimum width=2*smallcirclewidth,
label=otherside:iplusone] at (C.angle) ;

uncover<iplustwo> % fill one small circle per frame
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11



Note: as an alternative to the following code:



pgfmathsetmacroiplustwoint(i+2)

(...)

uncover<iplustwo-> (...)
uncover<iplustwo> (...)


one could use, assuming e-TeX extensions are available:



uncover<thenumexpr i+2relax-> (...) 
uncover<thenumexpr i+2relax> (...)


Now, let's redo the same beamer presentation, but using a more straightforward order (small circles at angles 1*360/10, 2*360/10, ..., 10*360/10 degrees, respectively). The main code is written in a (slightly) different way from the previous example: it uses two loops and the pause macro from beamer, whereas the first example did everything in one loop, and used only uncover.



documentclassbeamer
usepackageexpl3
usepackagetikz

ExplSyntaxOn
% Borrow a loop macro from expl3
cs_set_eq:NN intstepvariable int_step_variable:nnnNn
ExplSyntaxOff

begindocument

beginframeCircles in circle
begincenter
begintikzpicture
defnsteps10
defbigcircleradius3cm
defsmallcirclewidth0.5cm

% The big circle
node[circle, minimum width=2*bigcircleradius, draw] (C) ;

% The filled circles: highlight a single small circle on each frame starting
% from frame 2.
intstepvariable21nsteps+1i% initstepfinalvariable
pgfmathsetmacroangle(i-1)*360/nsteps
uncover<i>
node[circle, fill=red!20, minimum width=2*smallcirclewidth]
at (C.angle) ;



% The unfilled circles and their labels
intstepvariable11nstepsi% initstepfinalvariable
pgfmathsetmacroanglei*360/nsteps
pgfmathsetmacroothersideangle+180

pause
node[circle, draw, minimum width=2*smallcirclewidth, label=otherside:i]
at (C.angle) ;


endtikzpicture
endcenter
endframe

enddocument


Page 1



Page 2



Page 3



...



Page 6



...



Page 11







share|improve this answer














share|improve this answer



share|improve this answer








edited 3 hours ago

























answered 6 hours ago









frougonfrougon

5,1571 gold badge10 silver badges20 bronze badges




5,1571 gold badge10 silver badges20 bronze badges












  • Thx for the answer maybe next time i use this in another project but for now i'm going to go with the solution not requiring additional package setup like the usepackageexpl3

    – user1319236
    6 hours ago











  • +1, but I would have expected an l3draw circle :D

    – TeXnician
    4 hours ago











  • @TeXnician Thanks! Regarding l3draw, I believe its edges are still a bit rough for me. :-p

    – frougon
    4 hours ago

















  • Thx for the answer maybe next time i use this in another project but for now i'm going to go with the solution not requiring additional package setup like the usepackageexpl3

    – user1319236
    6 hours ago











  • +1, but I would have expected an l3draw circle :D

    – TeXnician
    4 hours ago











  • @TeXnician Thanks! Regarding l3draw, I believe its edges are still a bit rough for me. :-p

    – frougon
    4 hours ago
















Thx for the answer maybe next time i use this in another project but for now i'm going to go with the solution not requiring additional package setup like the usepackageexpl3

– user1319236
6 hours ago





Thx for the answer maybe next time i use this in another project but for now i'm going to go with the solution not requiring additional package setup like the usepackageexpl3

– user1319236
6 hours ago













+1, but I would have expected an l3draw circle :D

– TeXnician
4 hours ago





+1, but I would have expected an l3draw circle :D

– TeXnician
4 hours ago













@TeXnician Thanks! Regarding l3draw, I believe its edges are still a bit rough for me. :-p

– frougon
4 hours ago





@TeXnician Thanks! Regarding l3draw, I believe its edges are still a bit rough for me. :-p

– frougon
4 hours ago










user1319236 is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















user1319236 is a new contributor. Be nice, and check out our Code of Conduct.












user1319236 is a new contributor. Be nice, and check out our Code of Conduct.











user1319236 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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f500521%2fdrawing-a-circle-with-nodes-shift-with-tikz%23new-answer', 'question_page');

);

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







Popular posts from this blog

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480