1 Hour
Milestone 1: CPU Telemetry Trends
Project Task: Telemetry Plotting
Your objective is to generate a visualization of CPU load values over 10 consecutive time steps. Utilize plt.subplots to initialize your figure, then plot the array of load values against the timestamps. Apply 'grid(True)' for readability, set the X-axis label to 'Time (s)', the Y-axis label to 'Load (%)', and save the final result as cpu_trend.png.
Operator Note: Ensure you call
plt.savefig before plt.show to avoid capturing an empty canvas.
Python 3
import matplotlib.pyplot as plt timestamps = range(1, 11) cpu_loads = [20, 25, 45, 60, 55, 70, 85, 90, 80, 75] fig, ax = plt.subplots() ax.plot(timestamps, cpu_loads, marker='o') ax.set_xlabel('Time (s)') ax.set_ylabel('Load (%)') ax.grid(True) plt.savefig('cpu_trend.png')
Knowledge Check
Ready to test your understanding of Milestone 1: CPU Telemetry Trends?
Previous
5. Customizing Legends & Ticks
Locked
Complete Challenge to Unlock