Advertisement
azakharov93
Dec 3rd, 2022
46
0
Never
This is comment for paste two_objects_simple_task
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # How to print the orbits
  2. import pandas as pd
  3. import matplotlib.pyplot as plt
  4.  
  5. path = r"D:\other\tom_and_jerry\planet_motion\planets_pathway.csv"
  6.  
  7. if __name__ == '__main__':
  8.     df =pd.read_csv(path)
  9.  
  10.     ax = df.plot(x="sun_x", y="sun_y", color='C3', label='sun')
  11.     df.plot(x="earth_x", y="earth_y", color='C0', label='earth', ax=ax)
  12.  
  13.     plt.xlabel('X-coordinate')
  14.     plt.ylabel('Y-coordinate')
  15.     plt.grid(True)
  16.     plt.title('Rotation of Earth Around the Sun')
  17.     plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement