Note
Go to the end to download the full example code.
Sector textΒΆ
A text can be shown in a sector by the texts argument.
import plotly
import ptvis
elements = list(ptvis.Element) * 2
radii = [1]*len(ptvis.Element) + [2]*len(ptvis.Element)
texts = [str(i % 10) for i in range(len(elements))]
fig = plotly.graph_objects.Figure()
ptvis.attach_polar_bar_cells(fig, elements, radii, texts=texts)
plotly.io.show(fig)
The color of texts are selected so as to be a high contrast ratio to a sector. Candidates for the text color can be given by the text_colorway argument.
import plotly
import ptvis
elements = list(ptvis.Element) * 2
radii = [1]*len(ptvis.Element) + [2]*len(ptvis.Element)
texts = [str(i % 10) for i in range(len(elements))]
fig = plotly.graph_objects.Figure()
ptvis.attach_polar_bar_cells(
fig,
elements,
radii,
texts=texts,
text_colorway=["#ff0000", "#ffcccc"],
)
plotly.io.show(fig)