Advertisement
khaiwen1111

Untitled

Mar 8th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. import pandas as pd
  4. plt.rcParams['axes.grid'] = True
  5. fig,ax=plt.subplots(3,2,figsize=(10,6))
  6. df1=pd.read_csv(r"D:\Users\abc\cov60.csv")
  7. df2=pd.read_csv(r"D:\Users\abc\cov75.csv")
  8. df3=pd.read_csv(r"D:\Users\abc\cov85.csv")
  9. df4=pd.read_csv(r"D:\Users\abc\cov95.csv")
  10. ax[0,0].scatter(df1["xy"],df1["yx"],color="black")
  11. ax[1,0].scatter(df2["xy"],df2["yx"],color="gold")
  12. ax[1,1].scatter(df3["xy"],df3["yx"],color="blue")
  13. ax[2,1].scatter(df4["xy"],df4["yx"],color="maroon")
  14. ax[0,1].axis("off")
  15. ax[2,0].axis("off")
  16.  
  17.  
  18.  
  19. xticks=np.linspace(60,100,3)
  20. yticks=np.linspace(25,100,4)
  21.  
  22. ###the reason of using linspace is we can easily set the range, for xticks we want 60 80 100 , so range from 80 to 100 and 3 numbers###
  23.  
  24. ax[0,0].set_xticks(xticks)
  25. ax[0,0].set_yticks(yticks)
  26. ax[1,0].set_xticks(xticks)
  27. ax[1,0].set_yticks(yticks)
  28. ax[1,1].set_xticks(xticks)
  29. ax[1,1].set_yticks(yticks)
  30. ax[2,1].set_xticks(xticks)
  31. ax[2,1].set_yticks(yticks)
  32.  
  33. ###comment this out and see what happened to yaxis###
  34. yticks1= ax[0,0].yaxis.get_major_ticks()
  35. yticks1[0].label.set_visible(False)
  36. yticks2= ax[1,0].yaxis.get_major_ticks()
  37. yticks2[0].label.set_visible(False)
  38. yticks3= ax[1,1].yaxis.get_major_ticks()
  39. yticks3[0].label.set_visible(False)
  40. yticks4= ax[2,1].yaxis.get_major_ticks()
  41. yticks4[0].label.set_visible(False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement