Note
Go to the end to download the full example code.
Sector proportionΒΆ
By default, sectors are of equal proportion. The proportions can be determined by the angles argument.
import plotly
import ptvis
elements = list(ptvis.Element) * 3
angles = (
[50]*len(ptvis.Element)
+ [50]*len(ptvis.Element)
+ list(range(len(ptvis.Element)))
)
fig = plotly.graph_objects.Figure()
ptvis.attach_pie_cells(fig, elements, angles=angles)
plotly.io.show(fig)
Notice that data are not sorted and are arranged clockwise for each chemical element.