Skip to content

sedaoturak/cmap_periodictable

 
 

Repository files navigation

Color Map Plotter on Periodic Table

This Python script (ptable_trends.py) can be used to plot a heat map over an image of the periodic table of elements for easy and automated visualization of trends.

Usage

A minimal example is as follows (and can be access through this notebook):

from ptable_trends import ptable_plotter
ptable_plotter("ionization_energies.csv")

plot1

The only required argument to ptable_plotter() is a single positional argument for the full filepath/name (with extension) of the data file containing your trend data. The data file must be in a comma-separated value (.csv) format with the first entry in each row being the atom symbol and the second entry being the value you wish to plot. An example .csv file is included in this repository for testing purposes under the name ionization_energies.csv. After the ptable_trends.py script is run, it will show the plot in your web browser. To save the image, simply click the save icon that appears in the web browser figure.

There are numerous optional arguments, which can be used to modify the appearance of the figure. The full argument list can be found under the definition of ptable_plotter() function in the ptable_trends.py script:

A couple of examples using various optional keyword arguments are as follows:

from ptable_trends import ptable_plotter
ptable_plotter("ionization_energies.csv", log_scale=True)

plot2

from ptable_trends import ptable_plotter
ptable_plotter("ionization_energies.csv", cmap="viridis", alpha=0.7, extended=False, periods_remove=[1])

plot3

Dependencies

The script requires the following dependencies:

These packages can be installed using pip via pip install -r requirements.txt in the ptable_trends base directory.

About

Python script to plot periodic trends as a heat map over the periodic table of elements

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 78.2%
  • Python 21.8%