Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. %matplotlib inline
  4. plt.rcParams['figure.figsize']=4,4
  5.  
  6. plt.contour(
  7. np.arange(-1,1,0.01),
  8. np.arange(-1,1,0.01),
  9. np.angle(t[...,None] + 1j*t[None,...]) ,
  10. levels = 2*np.pi*np.arange(-1,1,0.025)
  11. )
  12.  
  13. t = np.arange(-1,1,0.025)
  14. plt.contour(t,t, np.angle(t[...,None] + 1j*t[None,...]) , levels = 2*np.pi*np.arange(-1,1,0.025))
  15.  
  16. L = 0.25
  17. plt.xlim([-L,L])
  18. plt.ylim([-L,L])
  19.  
  20. import inspect
  21. print inspect.getsource(plt.contour)
  22.  
  23. @_autogen_docstring(Axes.contour)
  24. def contour(*args, **kwargs):
  25. ax = gca()
  26. # allow callers to override the hold state by passing hold=True|False
  27. washold = ax.ishold()
  28. hold = kwargs.pop('hold', None)
  29. if hold is not None:
  30. ax.hold(hold)
  31. try:
  32. ret = ax.contour(*args, **kwargs)
  33. draw_if_interactive()
  34. finally:
  35. ax.hold(washold)
  36. if ret._A is not None: sci(ret)
  37. return ret
  38.  
  39. print inspect.getsource(plt.Axes.contour)
  40.  
  41. def contour(self, *args, **kwargs):
  42. if not self._hold:
  43. self.cla()
  44. kwargs['filled'] = False
  45. return mcontour.QuadContourSet(self, *args, **kwargs)
  46.  
  47. import matplotlib
  48. print inspect.getsource(matplotlib.contour.QuadContourSet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement