Skip to content

pos_dict of CubeGraph(3) is not useful #37040

@pelegm

Description

@pelegm

Steps To Reproduce

graphs.CubeGraph(3).plot()

Expected Behavior

A plot in which each vertex appears in a different spot.
Better: a plot that looks like a cube.
(yes, I know the method plot3d)

Actual Behavior

The vertices 010 and 101 appear at the same point in the drawing.
Indeed, this can be seen by checking _pos:

sage: graphs.CubeGraph(3)._pos
{'000': (0.0, 0.0),
 '001': (-0.4999999999999998, 0.8660254037844387),
 '010': (0.5000000000000001, 0.8660254037844386),
 '011': (3.3306690738754696e-16, 1.7320508075688772),
 '100': (1.0, 0.0),
 '101': (0.5000000000000002, 0.8660254037844387),
 '110': (1.5, 0.8660254037844386),
 '111': (1.0000000000000002, 1.7320508075688772)}

Additional Information

This looks slightly more like what I would have expected:

{'000': (0,0), '001': (0,1), '010': (1,0), '011': (1,1), '100': (0.707,0.707), '101': (0.707,1.707), '110': (1.707,0.707), '111': (1.707,1.707)}

Environment

- **OS**: Ubuntu 20.04
- **Sage Version**: 9.0 (but also verified this on 9.5)

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions