Take the 2-minute tour ×

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.

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

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}
share|improve this answer
add comment

Your Answer


