Note
Go to the end to download the full example code.
Separated layout¶
The ptvis.layouts.SeparatedTableLayout class defines a layout of the
periodic table whose f-block is separated from the others.
import plotly
import ptvis.layouts
elements = list(ptvis.Element)
fig = plotly.graph_objects.Figure()
ptvis.attach_plain_cells(
fig,
elements,
table_layout=ptvis.layouts.SeparatedTableLayout(),
)
plotly.io.show(fig)
Symbols for the f-block¶
Symbols for the f-block can be changed by the lanthanoids_symbol and actinoids_symbol arguments.
import plotly
import ptvis.layouts
elements = list(ptvis.Element)
fig = plotly.graph_objects.Figure()
ptvis.attach_plain_cells(
fig,
elements,
table_layout=ptvis.layouts.SeparatedTableLayout(
lanthanoids_symbol="*",
actinoids_symbol="**",
),
)
plotly.io.show(fig)
The width for the symbols can be changed by the symbol_width argument.
import plotly
import ptvis.layouts
elements = list(ptvis.Element)
fig = plotly.graph_objects.Figure()
ptvis.attach_plain_cells(
fig,
elements,
table_layout=ptvis.layouts.SeparatedTableLayout(symbol_width=2.),
)
plotly.io.show(fig)
Separation above the f-block¶
A separation between the f-block and the others can be changed by the separation argument.
import plotly
import ptvis.layouts
elements = list(ptvis.Element)
fig = plotly.graph_objects.Figure()
ptvis.attach_plain_cells(
fig,
elements,
table_layout=ptvis.layouts.SeparatedTableLayout(separation=2.),
)
plotly.io.show(fig)
Padding around the periodic table¶
A padding around the periodic table can be changed by the padding argument.
import plotly
import ptvis.layouts
elements = list(ptvis.Element)
fig = plotly.graph_objects.Figure()
ptvis.attach_plain_cells(
fig,
elements,
table_layout=ptvis.layouts.SeparatedTableLayout(padding=1.),
)
plotly.io.show(fig)