Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- import numpy as np
- import matplotlib.pyplot as plt
- # Load Data
- affinity = np.loadtxt("affinity4.dat", usecols=(0,2))
- ionization = np.loadtxt("ionization3.dat", usecols=(0,2))
- # Initialize empty lists
- finaff = []
- finion = []
- atomnum = []
- # Find the common atoms in my data
- for i in range(affinity.shape[0]):
- for j in range(ionization.shape[0]):
- if affinity[i,0] == ionization[j,0] :
- finaff += [affinity[i,1]]
- finion += [ionization[i,1]]
- atomnum += [affinity[i,0]]
- cm = plt.get_cmap("Greys")
- normnum = atomnum
- fig = plt.figure(figsize=(8,6))
- scat = plt.scatter(finaff, finion, s=30, c=normnum, cmap=cm)
- plt.xlabel("Electron Affinity [eV]", labelpad=10)
- plt.xlim(-0.08,4)
- plt.ylabel("1. Ionisation Energy [eV]", labelpad=10)
- cbar = plt.colorbar(scat)
- cbar.set_label("Atom Number", labelpad=10)
- plt.savefig("theplot.png", dpi=80)
Add Comment
Please, Sign In to add comment