Tuesday, September 27, 2016

Python: Matplotlib: Histogram Dark Background Example

Command:

$ cat testhistogram.py


Result:

#!/usr/local/bin/python

import matplotlib.pyplot as plt
plt.style.use('dark_background')

from numpy.random import normal,rand
x = normal(size=200)
plt.hist(x,bins=30)
plt.show()


Command:

$ python testhistogram.py


Graphical output: