Tuesday, September 27, 2016

Python: Matplotlib: Scatter Plot Dark Background Example

Command:

$ cat testscatterplot.py


Result:

#!/usr/local/bin/python

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

from numpy.random import rand
a = rand(100)
b = rand(100)
plt.scatter(a,b)
plt.show()


Command:

$ python testscatterplot.py


Graphical output: