I have plotted two arrays using Matplotlib stem command as follow:
markerline, stemlines, baseline = stem(n,x,linefmt='b')
axis([0,6,0,1.2])
grid()
setp(stemlines, 'linewidth','2.0')
Now i want to modify the color of the stemlines, so i tried the following syntax but it gave me error.
setp(stemlines, 'linfmt','b-')
setp(stemlines, 'color','b-')
Is there a way i can modify the color or other attributes of these lines in general without have to specify them at the time of instantiation (i.e. using stem command)
You must use only a color key. You are using a color+line-type
Note you can use either matlab or python style, although I prefer the python one:
You can also modify your lines one by one taking them from the stemlines list. For example: