Note
Go to the end to download the full example code.
Cell textΒΆ
A text can be shown in a cell by the texts argument.
import plotly
import ptvis
elements = list(ptvis.Element)
texts = [element.symbol for element in elements]
fig = plotly.graph_objects.Figure()
ptvis.attach_plain_cells(fig, elements, texts=texts)
plotly.io.show(fig)
The color of texts are selected so as to be a high contrast ratio to a cell. Candidates for the text color can be given by the text_colorway argument.
import plotly
import ptvis
elements = list(ptvis.Element)
texts = [element.symbol for element in elements]
fig = plotly.graph_objects.Figure()
ptvis.attach_plain_cells(
fig,
elements,
texts=texts,
text_colorway=["#ff0000", "#ffcccc"],
)
plotly.io.show(fig)