mahmoodn

Untitled

Jan 3rd, 2021 (edited)
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. import pandas as pd
  2. import matplotlib.pyplot as plt
  3. from matplotlib.figure import Figure
  4.  
  5. # sample file
  6. #F1,F2,F3
  7. #4.527,-1.082,-2.776
  8. #4.599,-1.132,-2.858
  9. #-1.015,0.557,0.120
  10. #2.352,0.066,0.059
  11. op = pd.read_csv("observation_points.csv")
  12. of1 = op['F1'].values
  13. of2 = op['F2'].values
  14. of3 = op['F3'].values
  15.  
  16. # sample file
  17. #F1,F2,F3
  18. #-0.140,0.499,-0.658
  19. #0.729,-0.082,-0.543
  20. #0.870,-0.042,-0.035
  21. vp= pd.read_csv("variable_points.csv")
  22. vf1 = vp['F1'].values
  23. vf2 = vp['F2'].values
  24. vf3 = vp['F3'].values
  25.  
  26. fig = plt.figure(figsize = (16,8))
  27. ax = fig.add_subplot(1, 2, 2)
  28. ax.scatter( of1, of2, c=colors )
  29. ax.set_xlabel('F1', fontsize = 15)
  30. ax.set_ylabel('F2', fontsize = 15)
  31. ax.grid()
  32.  
  33.  
  34. ax2 = fig.add_subplot(1, 2, 1)
  35. ax2.scatter( vf1, vf2 )
  36. ax = plt.axes()
  37. for i in range(len(vp.index)):
  38.    px = vf1[ i ]
  39.    py = vf2[ i ]
  40.    ax.arrow(0, 0, px, py, head_width=0, head_length=0.1, length_includes_head=True)
  41.  
  42. circle = plt.Circle((0, 0), 1, facecolor='none', edgecolor='b')
  43. ax2.add_artist(circle)
  44. ax2.set_xlabel('F1', fontsize = 15)
  45. ax2.set_ylabel('F2', fontsize = 15)
  46. ax2.grid()
  47.  
Add Comment
Please, Sign In to add comment