Skip to content

Instantly share code, notes, and snippets.

@ryananeff
ryananeff / heatmap_circles.py
Last active September 17, 2024 00:09
[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
@specter119
specter119 / periodic_table.py
Last active October 30, 2024 14:53
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):