#NEWLINE# def plot_isocontours( ax , func , xlimits = [ ( - 2 ) , 2 ] , ylimits = [ ( - 4 ) , 2 ] , numticks = 101 ) : #NEWLINE# #INDENT# x = np . linspace ( * xlimits , num = numticks ) #NEWLINE# y = np . linspace ( * ylimits , num = numticks ) #NEWLINE# ( X , Y ) = np . meshgrid ( x , y ) #NEWLINE# zs = func ( np . concatenate ( [ np . atleast_2d ( X . ravel ( ) ) , np . atleast_2d ( Y . ravel ( ) ) ] ) . T ) #NEWLINE# Z = zs . reshape ( X . shape ) #NEWLINE# plt . contour ( X , numticks , Z ) #NEWLINE# ax . set_yticks ( [ ] ) #NEWLINE# ax . set_xticks ( [ ] )