Created
January 1, 2024 17:29
-
-
Save irudnyts/3d3d58e7b6a4fdc057cbd288acacd49b to your computer and use it in GitHub Desktop.
This file contains 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
import datetime as dt | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
import MacTmp | |
fig, axs = plt.subplots(3) | |
xs = [] | |
ys = [] | |
def animate(i, xs, ys): | |
temp_c = float(MacTmp.CPU_Temp()) | |
xs.append(i) | |
ys.append(temp_c) | |
xs = xs[-20:] | |
ys = ys[-20:] | |
axs[0].clear() | |
axs[1].clear() | |
axs[2].clear() | |
axs[0].plot(xs, ys) | |
axs[1].plot(xs, ys) | |
axs[2].plot(xs, ys) | |
axs[0].set(ylabel="X") | |
axs[1].set(ylabel="Y") | |
axs[2].set(ylabel="Z") | |
ani = animation.FuncAnimation(fig, animate, fargs=(xs, ys), interval=100) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment