File: plot_band.py

package info (click to toggle)
phonopy 2.48.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,556 kB
  • sloc: python: 44,403; xml: 12,080; ansic: 3,227; cpp: 525; sh: 213; makefile: 20
file content (18 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Script to plot unfolding result."""

import sys

import matplotlib.pyplot as plt
import numpy as np

if len(sys.argv) > 1:
    filename = sys.argv[1]
else:
    filename = "bin-unfolding.dat"

x, y, z = np.loadtxt(filename).T
idx = z.argsort()
x, y, z = x[idx], y[idx], z[idx]
sc = plt.scatter(x, y, c=z, s=30, vmin=0, edgecolor=None, cmap="Greys")
plt.colorbar(sc)
plt.show()