def strips(x,Nx,fig_size=(<NUM_LIT:6>,<NUM_LIT:4>)):
plt.figure(figsize=fig_size)<EOL>N = len(x)<EOL>Mx = int(np.ceil(N/float(Nx)))<EOL>x_max = np.max(np.abs(x))<EOL>for kk in range(Mx):<EOL><INDENT>plt.plot(np.array([<NUM_LIT:0>,Nx]),-kk*Nx*np.array([<NUM_LIT:1>,<NUM_LIT:1>]),'<STR_LIT>')<EOL>plt.plot(x[kk*Nx:(kk+<NUM_LIT:1>)*Nx]/x_max*<NUM_LIT>*Nx-kk*Nx,'<STR_LIT:b>')<EOL><DEDENT>plt.axis([<NUM_LIT:0>,Nx,-Nx*(Mx-<NUM_LIT:0.5>),Nx*<NUM_LIT:0.5>])<EOL>plt.yticks(np.arange(<NUM_LIT:0>,-Nx*Mx,-Nx),np.arange(<NUM_LIT:0>,Nx*Mx,Nx))<EOL>plt.xlabel('<STR_LIT>')<EOL>plt.ylabel('<STR_LIT>')<EOL>return <NUM_LIT:0><EOL>
Plots the contents of real ndarray x as a vertical stacking of
strips, each of length Nx. The default figure size is (6,4) inches.
The yaxis tick labels are the starting index of each strip. The red
dashed lines correspond to zero amplitude in each strip.

strips(x,Nx,my_figsize=(6,4))

Mark Wickert April 2014