/periodic-table-plotter

Make periodic table map plots and pettifor-style trend plots.

Primary LanguagePythonMIT LicenseMIT

periodic-table-plotter

Build Status

Make a periodic table that plots 1-4 values per tile, easily configure grids of pair-wise elemental data (with 1-4 values per tile) and create pettifor-style trend plots.

Periodic table with one value per tile

def eneg(elt):
    """Electronegativity"""
    return elt['electronegativity']

epd = ElementDataPlotter()
epd.ptable([eneg])
plt.show()

Single value colormap

Periodic table with two values per tile

def mass(elt):
    """Mass"""
    return elt['mass']

epd = ElementDataPlotter()
epd.ptable([eneg, mass])
plt.show()

Double value colormap

Periodic table with three values per tile

def rat(elt):
    """Mass/Electronegativity"""
    return elt['electronegativity']/elt['mass']

epd = ElementDataPlotter()
epd.ptable([eneg, mass, rat])
plt.show()

Triple value colormap

Periodic table with four values per tile

def atomic_number(elt):
    """Atomic number"""
    return elt['z']

epd = ElementDataPlotter()
epd.ptable([eneg, mass, rat, atomic_number])
plt.show()

Quadrupel value colormap

Pettifor style map:

elts = ['H', 'Li', 'Be', 'Fe', 'Ni', 'Pd', 'Pt', 'F', 'Xe', 'O', 'S']
epd = ElementDataPlotter(elements=elts)
epd.pettifor(mass, eneg)
plt.savefig('pettifor.png', bbox_inches='tight')
plt.show()

Pettifor map

Grid of pair-wise elemental data:

elts = [ 'Ti', 'V', 'Sc', 'Ni', 'Co', 'Fe' ]
epd = ElementDataPlotter()
epd.make_grid(xelts=elts, yelts=elts)
plt.show()

Pair data