Visualization of polyhedron objects in Sage

Author: sarah-marie belcastro <>, Jean-Philippe Labbé <>

There are different ways to visualize polyhedron object of dimension at most 4.


This plots the polyhedron as a solid. You can also adjust the opacity parameter.

sage: Cube = polytopes.cube()
sage: Cube.render_solid(opacity=0.7)
Graphics3d Object


This plots the graph (with unbounded edges) of the polyhedron

sage: Cube.render_wireframe()
Graphics3d Object


The plot method draws the graph, the polygons and vertices of the polyhedron all together.

sage: Cube.plot()
Graphics3d Object


This is similar to plot but does not return an object that you can manipulate.


It is possible to visualize 4-dimensional polytopes using a schlegel diagram.

sage: HC = polytopes.hypercube(4)
sage: HC.schlegel_projection()
The projection of a polyhedron into 3 dimensions
sage: HC.schlegel_projection().plot()
Graphics3d Object

We can see it from a different perspective:

sage: HC.schlegel_projection([2,5,11,17]).plot()
Graphics3d Object