Guest User

Untitled

a guest
May 27th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import matplotlib
  2. import numpy as np
  3. import matplotlib.cm as cm
  4. import matplotlib.mlab as mlab
  5. import matplotlib.pyplot as plt
  6.  
  7. matplotlib.rcParams['xtick.direction'] = 'out'
  8. matplotlib.rcParams['ytick.direction'] = 'out'
  9.  
  10. delta = 0.025
  11. x = np.arange(-3.0, 3.0, delta)
  12. y = np.arange(-2.0, 2.0, delta)
  13. X, Y = np.meshgrid(x, y)
  14. Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
  15. Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
  16. # difference of Gaussians
  17. Z = 10.0 * (Z2 - Z1)
  18.  
  19.  
  20. # Create a simple contour plot with labels using default colors. The
  21. # inline argument to clabel will control whether the labels are draw
  22. # over the line segments of the contour, removing the lines beneath
  23. # the label
  24. plt.figure()
  25. CS = plt.contour(X, Y, Z)
  26. plt.clabel(CS, inline=1, fontsize=10)
  27. plt.title('Simplest default with labels')
  28.  
  29. plt.savefig('plot.pgf')
Add Comment
Please, Sign In to add comment