How to make thicker stem lines in matplolib
<p>I want to make thicker stem lines in python when using <code>plt.stem</code>.</p>

<p>Here is my code</p>

<pre><code>import matplotlib.pyplot as plt
import numpy as np

N = 20

n = np.arange(0, 2*N, 1)

x = np.exp(-n/N)*np.exp(1j * 2*np.pi/N*n)

plt.stem(n,x.real) 

plt.show()
</code></pre>

<p>I changed <code>plt.stem(n,x.real,linewidth=10)</code>, but nothing changed. Is there no function to set the <code>linewidth</code> in <code>plt.stem</code>?</p>

<p>This can also be modified using <code>plt.setp()</code> as is shown in the matplotlib documentation <a href="http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.stem" rel="nofollow">example</a>.  The <a href="http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.setp" rel="nofollow"><code>plt.setp()</code> method</a> allows you to set the properties of an artist object after it has been created.</p>

<pre><code>import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0.1, 2*np.pi, 10)
markerline, stemlines, baseline = plt.stem(x, np.cos(x), '-.')
plt.setp(stemlines, 'linewidth', 4)

plt.show()
</code></pre>

<p><a href="http://i.stack.imgur.com/RFopi.png" rel="nofollow"><img src="http://i.stack.imgur.com/RFopi.png" alt="enter image description here"></a></p>

python stem