Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit b0ed0a7

Browse files
author
Matthias Koeppe
committed
src/sage/geometry/polyhedral_complex.py (exploded_rainbow_plot): Accepts dicts for sticky_vertices, sticky_center
1 parent 9eebc32 commit b0ed0a7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/sage/geometry/polyhedral_complex.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -2465,11 +2465,11 @@ def exploded_rainbow_plot(polyhedra, *,
24652465
- ``explosion_factor`` -- (default: 1) a nonnegative number; translate polyhedra by this
24662466
factor of the distance from ``center`` to their center
24672467
2468-
- ``sticky_vertices`` -- (default: ``False``) whether to draw line segments between shared
2469-
vertices of the given polyhedra
2468+
- ``sticky_vertices`` -- (default: ``False``) boolean or dict. Whether to draw line segments between shared
2469+
vertices of the given polyhedra. A dict gives options for :func:`sage.plot.line`.
24702470
2471-
- ``sticky_center`` -- (default: ``True``) whether to draw line segments between ``center``
2472-
and the vertices of the given polyhedra
2471+
- ``sticky_center`` -- (default: ``True``) boolean or dict. Whether to draw line segments between ``center``
2472+
and the vertices of the given polyhedra. A dict gives options for :func:`sage.plot.line`.
24732473
24742474
- other keyword arguments are passed on to :meth:`~sage.geometry.polyhedron.base.Polyhedron_base.plot`.
24752475
@@ -2512,15 +2512,19 @@ def exploded_rainbow_plot(polyhedra, *,
25122512
vertex_translations_dict[v] = vertex_translations_dict.get(v, [])
25132513
vertex_translations_dict[v].append(v + t)
25142514
if sticky_vertices or sticky_center:
2515+
if sticky_vertices is True:
2516+
sticky_vertices = dict(color='gray')
2517+
if sticky_center is True:
2518+
sticky_center = dict(color='gray')
25152519
for vertex, vertex_translations in vertex_translations_dict.items():
25162520
if vertex == center:
25172521
if sticky_center:
25182522
for vt in vertex_translations:
2519-
g += line((center, vt), color='gray')
2523+
g += line((center, vt), **sticky_center)
25202524
else:
25212525
if sticky_vertices:
25222526
for vt1, vt2 in itertools.combinations(vertex_translations, 2):
2523-
g += line((vt1, vt2), color='gray')
2527+
g += line((vt1, vt2), **sticky_vertices)
25242528

25252529
if point is None:
25262530
point = dict(size=1.5)

0 commit comments

Comments
 (0)