I try to implement an Lowpass filter using a Hammond Window. The cut-off frequency it's 0.3 and the order of the filter it's 21. My problem is that I have a straight line and it's not crossing through the represented points. Here it's the code:
from pylab import *
import scipy.signal as signal
import matplotlib.pyplot as plt
#Plot step and impulse response
def impz(b,a=1):
l = len(b)
impulse = repeat(0.,l); impulse[0] =1.
x = arange(0,l)
response = signal.lfilter(b,a,impulse)
subplot(211)
stem(x, response)
ylabel('Amplitude')
xlabel(r'Index')
title(r'Impulse response')
n = 21
a = signal.firwin(n, cutoff = 0.3, window = "hamming")
#Impulse and step response
figure(2)
impz(a)
show()
I've attached you how should the pyplot look like: 
Why it's the red line in the last picture not crossing through the points of the plot? Any ideas why? Thanks!

plt.stemdraws dots with vertical lines connected via a baseline, as shown in your second plot. To draw dots and connected line segments, there isplt.plotwith many options.Note that usually
pyplotis imported asplt. That way, people can quickly see where the plotting related code is happening, which makes it easier to understand and maintain.Similarly,
numpyis imported asnp. Numpy functions can work on complete arrays similar to working with single variables ("broadcasting"), which only works fine when all functions and arrays use numpy. The prefixnphelps in visually checking this.Here is the sample code with the standard way of importing pyplot and numpy. And with a call to
plt.plotto obtain a plot similar to the desired one. The variable in the main code is renamed tobto make the call to theimpzfunction easier to follow.