Skip to content Skip to sidebar Skip to footer

Plotting D Orbital Diagrams Using Matplotlib (or Seaborn)

guys, I'm a chemist and I've finished an experiment that gave me the energies of a metal d orbitals. It is relatively easy to get the correct proportion of energies in Excel 1 and

Solution 1:

You can draw anything you like deriving from basic shapes and functions in matplotlib. Energy levels could be simple markers, the texts can be produced by annotate.

import numpy as np
import matplotlib.pyplot as plt


Energies = [-0.40008, -0.39583, -0.38466, -0.23478, -0.21239]
orbitals = ["$d_{z^2}$", "$d_{xy}$", "$d_{yz}$", "$d_{x^2 - y^2}$", "$d_{xz}$"]
x = np.arange(len(Energies))

fig, ax = plt.subplots()
ax.scatter(x, Energies, s=1444, marker="_", linewidth=3, zorder=3)
ax.grid(axis='y')

for xi,yi,tx in zip(x,Energies,orbitals):
    ax.annotate(tx, xy=(xi,yi), xytext=(0,-4), size=18,
                ha="center", va="top", textcoords="offset points")

ax.margins(0.2)
plt.show()

enter image description here

Post a Comment for "Plotting D Orbital Diagrams Using Matplotlib (or Seaborn)"