Skip to content

Instantly share code, notes, and snippets.

@specter119
specter119 / periodic_table.py
Last active December 1, 2023 11:20
Plot periodic table with Pymatgen and Matplotlib
import re
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.collections import PatchCollection
from pymatgen.core.periodic_table import Element
class PeriodicTablePlotter(object):
@ryananeff
ryananeff / heatmap_circles.py
Last active April 12, 2023 13:28
[Python] Clustermap with circles representing each element instead of squares for the heatmap
import numpy as np
import seaborn as sb
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.collections import PatchCollection
#### heatmap_circle()
##
## Creates a heatmap of values, with size of the circle at a given (row,col) as a second dimension
## uses seaborn's clustermap to provide biclustering