Stem structure with a continuous line

I need to plot a line plot of my signal using python and matplotlib.

I saw an example and code, but the line connecting the black big point and the x-axis is not a continuous line. Do you know if it is possible and how to get a straight line?

#!/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()

      

+2


a source to share


1 answer


Change '-.'

to '-'

:

markerline, stemlines, baseline = stem(x, cos(x), '-')

      



The last argument specifies the line style .

+4


a source







All Articles