Skip to content

Instantly share code, notes, and snippets.

@irudnyts
Created January 1, 2024 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irudnyts/3d3d58e7b6a4fdc057cbd288acacd49b to your computer and use it in GitHub Desktop.
Save irudnyts/3d3d58e7b6a4fdc057cbd288acacd49b to your computer and use it in GitHub Desktop.
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