Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to generate the Petrie polygon projection of the 8-cube in Mathematica, like this one:

enter image description here

I tried using, for example, the HypercubeGraph function:


which generates

enter image description here

As you can tell from the lack of symmetry (notice the shape of the innermost ring, for example), this is not the right projection. I also tried looking at some GraphPlot options like Method:

GraphPlot[HypercubeGraph[8], Method -> "SpringElectricalEmbedding"]

but to no avail. How can I generate the Petrie polygon projection of an 8-cube in Mathematica?

share|improve this question
up vote 10 down vote accepted

As I understand this, GraphData are based on many nice custom pre-set layouts. Graph is based on algorithms that compute layouts, so computation is not always guaranteed to result in a specially defined geometry.

SetProperty[GraphData[{"Hypercube", 8}], VertexStyle -> Red]

enter image description here

share|improve this answer
Thank you! Is there a way to label different vertices or color them differently according to a function? – Carlos Feb 23 at 0:20
@user1667423 VertexShapeFunction most generally with. You should take a good nickname. – Vitaliy Kaurov Feb 23 at 0:31
Thanks again! It doesn't seem like the projection is working properly for the 3-cube. Is it not currently possible to specify the Petrie projection in general? – Carlos Feb 23 at 1:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.