I'd like to modify the axis of a stem plot, e.g. to change the grid color with ax.grid(color='gray', axis='y')
in the stem plot example. How would I do that?
import matplotlib.pyplot as plt
import numpy as np
# returns 10 evenly spaced samples from 0.1 to 2*PI
x = np.linspace(0.1, 2 * np.pi, 10)
markerline, stemlines, baseline = plt.stem(x, np.cos(x), '-.')
# setting property of baseline with color red and linewidth 2
plt.setp(baseline, color='r', linewidth=2)