... matplotlib: settings


There are many settings available in plotting functions. The example below shows the usage of s. alpha and color.

import numpy as np
import matplotlib.pylab as plt

x, y = np.random.normal(0, 1, (2, 1000))
plt.scatter(x, y, s=10, alpha=0.5, color='pink')
x, y = np.random.normal(2, 0.5, (2, 1000))
plt.scatter(x, y, s=10, alpha=0.5, color='purple');

The example below demonstrates some of these settings used in histograms.

x1 = np.random.normal(0, 1, (1000))
x2 = np.random.normal(2, 1, (1000))
plt.hist(x1, alpha=0.5, color="purple", bins=30)
plt.hist(x2, alpha=0.2, color="orange", bins=30);

Again, note the semi-colon at the end here.

Feedback? See an issue? Something unclear? Feel free to mention it here.

If you want to be kept up to date, consider signing up for the newsletter.