Skip to content

elton-ogoshi/pthm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Periodic Table Heatmap

This repo provides a Python class that uses plotnine to plot a heatmap of the periodic table.

The values can represent any continuous element property (e.g. atomic radius, electronegativity)

The result is something like the plot below:

periodic table heatmap

Installation

To install the necessary dependencies for this project, run the following command:

pip install -r requirements.txt

Usage

from periodic_table_heatmap import PeriodicTableHeatMap
import pandas as pd

# Create a dataframe 'df' with necessary columns (In this example: 'elements' and 'atomic_radius')

heatmap = PeriodicTableHeatMap(df)
heatmap.plot('atomic_radius') # Input the column that has the continuous values for the elements
heatmap.save_fig('heatmap.pdf') # Save the plot as pdf

Here, df is a pandas DataFrame containing a column for the elements (element) and columns for the properties. The PeriodicTableHeatMap class is used to generate and save the heatmap.

The notebook demo.ipynb demonstrates how to use the class PeriodicTableHeatMap defined at pthm/core.py to plot the heatmap.

License

This project is licensed under the MIT License.

About

Simple periodic table heatmap plotting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published