Advanced visualization tutorial

Next to the high level plotting function mendeleev.vis.periodic_table, mendeleev offers two lower level functions that give you more control over the result. There are two plotting backends supported:

  1. Plotly (default)

  2. Bokeh

Note

Depending on your environment being the classic jupyter notebook or jupyterlab you might have to do additional configuration steps, so if you’re not getting expected results see plotly of bokeh documentation.

Accessing lower level plotting functions

There are two plotting functions, one for each of the backends:

  • periodic_table_plotly in mendeleev.vis.plotly

  • periodic_table_bokeh in mendeleev.vis.bokeh

that you can use to customize the visualizations even further.

Both functions take the same keyword arguments as the periodic_table function but the also require a DataFrame with periodic table data. That dataframe needs to have x and y columns for each element that play the role of coordinates. You can get the default data using the create_vis_dataframe function. Let’s start with an example using the plotly backend.

[1]:
from mendeleev.vis import create_vis_dataframe, periodic_table_plotly

The function has only one required argument which is the data itself.

[2]:
elements = create_vis_dataframe()
periodic_table_plotly(elements)