One of the most frustrating things is when you follow a tutorial on a book, and it doesn't work the way it should. I have little idea as to why this is not working. I'm using IPython right now to make my plots. I have this code:
from __future__ import division
fig,ax =subplots()
f=1.0# Hz, signal frequency
fs = 5.0 # Hz, sampling rate (ie. >= 2*f)
t= arange(-1,1+1/fs,1/fs) # sample interval, symmetric
# for convenience later
x= sin(2*pi*f*t)
ax.plot(t,x,'o-' )
ax.set_xlabel('Time' ,fontsize=18)
ax.set_ylabel(' Amplitude' ,fontsize=18)
Which gives the following graph:

Which is the graph expected in the book. But then when I add this additional code:
fig,ax = subplots()
ax.plot(t,x,'o-')
ax.plot(xmin = 1/(4*f)-1/fs*3,
xmax = 1/(4*f)+1/fs*3,
ymin = 0,
ymax = 1.1 )
ax.set_xlabel('Time',fontsize =18)
ax.set_ylabel('Amplitude',fontsize = 18)
And I get the same graph, even though I'm setting the graph range. I've tried doing it parameter by parameter, as I found in another question - ax.ymin = 0, ax.ymax = 1.1 , etc....
Why is this happening, and what can I do to view the "zoomed in" graph?
axis(xmin=, ....)notplot(xmin=,...). Probalby you should not blame the tutorial but someone else...