Doughnut chartsΒΆ

Cells can have holes by specifying the hole_diameter argument. The value corresponds to the largest possible cell diameter.

import plotly
import ptvis


elements = list(ptvis.Element) * 2

fig = plotly.graph_objects.Figure()
ptvis.attach_pie_cells(fig, elements, hole_diameter=0.5)

plotly.io.show(fig)

Texts can be drawn in the holes by specifying the hole_texts argument.

import plotly
import ptvis


elements = list(ptvis.Element) * 2

fig = plotly.graph_objects.Figure()
ptvis.attach_pie_cells(
    fig,
    elements,
    hole_diameter=0.5,
    hole_texts={element: element.symbol for element in ptvis.Element},
)

plotly.io.show(fig)

Gallery generated by Sphinx-Gallery