python - matplotlib: stem plot with horizontal offset -
i want draw 2 stem plots on same figure. here example:
i found stem plot example matplotlib: http://matplotlib.org/examples/pylab_examples/stem_plot.html
however, don't see how add offset stem plot. (+1 or +2 on y axis).
maybe plot type work me ? want display small events vertical bars.
this feature similar "basevalue" matlab stem plot.
you can use keyword, bottom
.
from pylab import * x = linspace(0.1, 2*pi, 10) markerline, stemlines, baseline = stem(x, cos(x), '-.', bottom=.5) setp(markerline, 'markerfacecolor', 'b') setp(baseline, 'color','r', 'linewidth', 2) show()
Comments
Post a Comment