Setiawan <stwn at unsoed.ac.id> CPU Temperature: Live-graphing • Type the code, save, and run • After the live graph is shown, execute a program, e.g. Chromium • Observe the graph from gpiozero import CPUTemperature from time import time import matplotlib.pyplot as plt cpu = CPUTemperature() plt.ion() # enable interactive mode x = [] # create dict x y = [] # create dict y while True: temp = cpu.temperature # get temp y.append(temp) # append temp to dict y x.append(time()) # append time to dict x plt.clf() # clear figure plt.scatter(x,y) # scatter plot for x and y plt.plot(x,y) # plot plt.pause(0.05) # pause plt.draw() # update figure cpu_temp-plot.py