Merge pull request #1265 from harvard-edge/vol1/ch4

Update a Matplotlib graph in vol1/ch4 (data_engineering.qmd)
This commit is contained in:
Vijay Janapa Reddi
2026-03-21 08:40:14 -04:00
committed by GitHub

View File

@@ -2027,11 +2027,20 @@ ax.fill_between(workers, 0, np.minimum(cpu_throughput, gpu_limit), color=COLORS[
# ┌── 4. DECORATE ──────────────────────────────────────────────────────────────
ax.text(4, 1500, "Starvation", color=COLORS['BlueLine'], fontweight='bold', ha='center', bbox=dict(facecolor='white', alpha=0.8, edgecolor='none', pad=0.5))
ax.text(12, 3200, "Saturated", color=COLORS['RedLine'], fontweight='bold', ha='center', bbox=dict(facecolor='white', alpha=0.8, edgecolor='none', pad=0.5))
ax.text(4.5, 1500, "Starvation", color=COLORS['BlueLine'], fontweight='normal', ha='center', bbox=dict(facecolor='white', alpha=0.8, edgecolor='none', pad=0.2))
ax.text(10, 3100, "Saturated", color=COLORS['RedLine'], fontweight='normal', ha='center', bbox=dict(facecolor='white', alpha=0.8, edgecolor='none', pad=0.2))
ax.set_xlabel('DataLoader Workers')
ax.set_ylabel('Throughput (img/s)')
ax.legend(loc='lower right', fontsize=8)
ax.legend(
loc='lower right',
fontsize=8,
frameon=True,
facecolor='white',
framealpha=0.95,
edgecolor='gray',
fancybox=True,
borderpad=0.6
)
plt.show()
plt.close()
```