Skip to content

Instantly share code, notes, and snippets.

@nasajpledu
Created February 9, 2021 18:18
Show Gist options
  • Save nasajpledu/73f94d3563d1cf80dcc31c90d12959cd to your computer and use it in GitHub Desktop.
Save nasajpledu/73f94d3563d1cf80dcc31c90d12959cd to your computer and use it in GitHub Desktop.
Code a Mars Landing - Step 5: Plot your solar-power data
plt.ion()
fig = plt.figure()
x_data = []
y_data = []
start_time = time()
x_data.append(elapsed_time)
y_data.append(lightlevel)
plt.title("Light Sensor input over time")
plt.ylabel("Light Level")
plt.xlabel("Time in seconds")
plt.plot(x_data, y_data)
plt.draw()
plt.pause(0.01)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment