Note
Go to the end to download the full example code.
BasicsΒΆ
The ptvis.attach_polar_bar_cells() function attaches the periodic table
with polar bar chart cells. An item of passed data corresponds with a sector.
import plotly
import ptvis
elements = [
element
for element in ptvis.Element
for _ in range((element.value-1)%3 + 1) # noqa: E228
]
radii = [i%4 + 1 for i in range(len(elements))] # noqa: E228
fig = plotly.graph_objects.Figure()
ptvis.attach_polar_bar_cells(fig, elements, radii)
plotly.io.show(fig)
Cells are drawn only for given elements.
import plotly
import ptvis
elements = [
ptvis.Element(z)
for z in range(1, 51)
for _ in range((z-1)%3 + 1) # noqa: E228
]
radii = [i%4 + 1 for i in range(len(elements))] # noqa: E228
fig = plotly.graph_objects.Figure()
ptvis.attach_polar_bar_cells(fig, elements, radii)
plotly.io.show(fig)