Created
February 9, 2021 18:18
-
-
Save nasajpledu/73f94d3563d1cf80dcc31c90d12959cd to your computer and use it in GitHub Desktop.
Code a Mars Landing - Step 5: Plot your solar-power data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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