Via the matplotlib.pyplot stem module
matplotlib.pyplot.stem (* args, ** kwargs)
from matplotlib.pyplot import stem stem(y, linefmt='b-', markerfmt='bo', basefmt='r-') stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-')
or closer to metal
#!/usr/bin/env python from pylab import * x = linspace(0.1, 2*pi, 10) markerline, stemlines, baseline = stem(x, cos(x), '-.') setp(markerline, 'markerfacecolor', 'b') setp(baseline, 'color','r', 'linewidth', 2) show()

Here
source share