Guest User

Untitled

a guest
Jul 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. x = arange(5)
  2. y = np.exp(5)
  3. plt.figure()
  4. plt.plot(x, y)
  5.  
  6. z = np.sin(x)
  7. plt.figure()
  8. plt.plot(x, z)
  9.  
  10. w = np.cos(x)
  11. plt.figure("""first figure""") # Here's the part I need
  12. plt.plot(x, w)
  13.  
  14. import matplotlib.pyplot as plt
  15. import numpy as np
  16.  
  17. x = np.arange(5)
  18. y = np.exp(x)
  19. fig1 = plt.figure()
  20. ax1 = fig1.add_subplot(111)
  21. ax1.plot(x, y)
  22.  
  23. z = np.sin(x)
  24. fig2 = plt.figure()
  25. ax2 = fig2.add_subplot(111)
  26. ax2.plot(x, z)
  27.  
  28. w = np.cos(x)
  29. ax1.plot(x, w) # can continue plotting on the first axis
  30.  
  31. x = arange(5)
  32. y = np.exp(5)
  33. plt.figure(0)
  34. plt.plot(x, y)
  35.  
  36. z = np.sin(x)
  37. plt.figure(1)
  38. plt.plot(x, z)
  39.  
  40. w = np.cos(x)
  41. plt.figure(0) # Here's the part I need
  42. plt.plot(x, w)
  43.  
  44. x = arange(5)
  45. y = np.exp(5)
  46. plt.figure(1)
  47. plt.plot(x, y)
  48.  
  49. z = np.sin(x)
  50. plt.figure(2)
  51. plt.plot(x, z)
  52.  
  53. w = np.cos(x)
  54. plt.figure(1) # Here's the part I need, but numbering starts at 1!
  55. plt.plot(x, w)
Add Comment
Please, Sign In to add comment