Advertisement
OreganoHauch

many subplots

Apr 19th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. %matplotlib inline
  3. import h5py
  4. import numpy as np
  5.  
  6. file = h5py.File("C:\\Users\\Jan\\Documents\\Physik & Mathe\\Bachelorarbeit\\h5 Dateien zum Ausprobieren\\positions.h5")
  7. x_axis = file["/data/encoder_fast/data"]
  8. y_axis = file["/data/encoder_slow/data"]
  9. x = list(x_axis)
  10. y = list(y_axis)
  11.  
  12.  
  13. index = range(1,len(y)+1)
  14.  
  15. x_1 = x[:5000]
  16. y_1 = y[:5000]
  17. x_2 = x[5000:10000]
  18. y_2 = y[5000:10000]
  19. x_3 = x[10000:15000]
  20. y_3 = y[10000:15000]
  21. x_4 = x[15000:20000]
  22. y_4 = y[15000:20000]
  23. x_5 = x[20000:25000]
  24. y_5 = y[20000:25000]
  25. x_6 = x[25000:30000]
  26. y_6 = y[25000:30000]
  27. x_7 = x[30000:35000]
  28. y_7 = y[30000:35000]
  29. x_8 = x[35000:40000]
  30. y_8 = y[35000:40000]
  31. x_9 = x[40000:42000]
  32. y_9 = y[40000:42000]
  33.  
  34. fig = plt.figure(figsize=(10, 8))
  35.  
  36. ax1 = plt.subplot2grid((3, 3), (0, 0))
  37. ax1.plot(x_1,y_1)
  38.  
  39. ax2 = plt.subplot2grid((3, 3), (0, 1))
  40. ax2.plot(x_2,y_2)
  41.  
  42. ax3 = plt.subplot2grid((3, 3), (0, 2))
  43. ax3.plot(x_3,y_3)
  44.  
  45. ax4 = plt.subplot2grid((3, 3), (1, 0))
  46. ax4.plot(x_4,y_4)
  47.  
  48. ax5 = plt.subplot2grid((3, 3), (1, 1))
  49. ax5.plot(x_5,y_5)
  50.  
  51. ax6 = plt.subplot2grid((3, 3), (1, 2))
  52. ax6.plot(x_6,y_6)
  53.  
  54. ax7 = plt.subplot2grid((3, 3), (2, 0))
  55. ax7.plot(x_7,y_7)
  56.  
  57. ax8 = plt.subplot2grid((3, 3), (2, 1))
  58. ax8.plot(x_8,y_8)
  59.  
  60. ax9 = plt.subplot2grid((3, 3), (2, 2))
  61. ax9.plot(x_9,y_9)
  62.  
  63.  
  64. plt.tight_layout()
  65. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement