python - matplotlib: stem plot with horizontal offset -


i want draw 2 stem plots on same figure. here example: enter image description here

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.

enter image description here

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

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -