Python Forum
Plotting help! Time is of the essence
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plotting help! Time is of the essence
#7
You can try to continue with the following piece of code:

i
mport matplotlib.pyplot as plt
# ---------- Constants ----------
SCALE = 10**6
EARTH_RADIUS  = 6378000 / SCALE
MOON_RADIUS = 1737000 / SCALE
MOON_DIST = 384e6 / SCALE
# -------------------------------

fig = plt.figure()
ax = fig.add_subplot(111)
Earth = plt.Circle((0, 0), EARTH_RADIUS, color='g', label = 'Earth')
Moon = plt.Circle((0, MOON_DIST), MOON_RADIUS, color ='r', label='Moon')
ax.add_artist(Moon)
ax.add_artist(Earth)
plt.xlabel('x-position (Mm)')
plt.ylabel('y-position (Mm)')
plt.xlim(-10 ** 7 / SCALE, 10**8 / SCALE)
plt.ylim(-10 ** 7 / SCALE, 4* 10**8 / SCALE)
ax.set_aspect('equal')
plt.grid()
plt.show()
AFAIK, Matplotlib is designed to make publication ready figures. It is possible to create
animation using Matplotlib, but it is not primarily designed for this.
Reply


Messages In This Thread
RE: Plotting help! Time is of the essence - by scidam - Mar-22-2019, 12:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Plotting by Time, error mansoorahs 1 811 May-16-2023, 09:46 AM
Last Post: Larz60+
  Non-blocking real-time plotting slow_rider 5 4,026 Jan-07-2023, 09:47 PM
Last Post: woooee
  time setup for realtime plotting of serial datas at high sampling rate alice93 6 3,968 Jan-07-2022, 05:41 PM
Last Post: deanhystad
  Plotting A Time Series With Shaded Recession Bars adamszymanski 1 3,258 Jan-24-2021, 09:08 PM
Last Post: nealc
  save in CSV and plotting in real time linkxxx 8 5,946 Sep-01-2019, 12:24 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020