TikZ allows regular polygons with specified number of sides for nodes. I'm using PGF though and want similar features and to be able to create my own custom shapes.

See percusse's answer for example code:

Tikz scale vs pgf scale



for the polygons.

What I would like is to be able to create a reference shape like rpoly7 that is simply a regular polygon with 7 sides that uses the TikZ shapes but can be passed to PGF like I do with the other shapes.

1 Answer 1


The regular polygon shape is not a "TikZ shape" (and neither are any of the other predefined shapes), they're all "PGF shapes". General rule: If the relevant keys in the pgfmanual include the /pgf directory, they're PGF keys. To set the parameters like regular polygon sides, you have to call \pgfkeys{/pgf/<option>=<value}:


\pgfkeys{/pgf/regular polygon sides=6,/pgf/minimum size=0.75cm}
\pgfnode{regular polygon}{center}{}{}{}
\pgfkeys{/pgf/regular polygon sides=3}
\pgfnode{regular polygon}{center}{}{}{}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .