Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[tikz,border=3.14mm]{standalone}
- usetikzlibrary{arrows.meta,shapes.geometric}
- newcounter{pft}
- begin{document}
- begin{tikzpicture}[font=sffamily,pics/cgram/.style={code={
- foreach XX [count=YY starting from 0] in {1,...,#1}
- {pgfmathsetmacro{mycolor}{{LstCols}[YY]}
- node[circle,draw,minimum size=2.5em,fill=mycolor] (c-#1-XX) at
- ({{LstAngles}[#1-2]-YY*360/#1}:1.5) {setcounter{pft}{XX}Alph{pft}};}
- foreach XX [evaluate=XX as Ymax using {int(XX-1)}] in {2,...,#1}
- {foreach YY in {1,...,Ymax}
- {pgfmathsetmacro{mycolorA}{{LstCols}[XX-1]}
- pgfmathsetmacro{mycolorB}{{LstCols}[YY-1]}
- draw[{Stealth[fill=mycolorB,length=7pt]}-{Stealth[fill=mycolorA,length=7pt]}] (c-#1-XX) -- (c-#1-YY);}}
- }}]
- defLstCols{"red","orange","yellow","green!70!black","blue!70!white","purple!80!white"}
- defLstAngles{180,150,135,128,120}
- path (-5,0) pic {cgram=2} (0,0.5) pic {cgram=3} (5,0) pic {cgram=4}
- (-3,-4) pic {cgram=5} (3,-4) pic {cgram=6};
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement