From 47f9b721941862a92ee790189a6d86adb3d34d96 Mon Sep 17 00:00:00 2001 From: florars3 Date: Mon, 25 May 2026 23:40:05 -0400 Subject: [PATCH] Fix Jupyter image display example --- .../05-jupyter-notebooks/docs/en.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/phases/00-setup-and-tooling/05-jupyter-notebooks/docs/en.md b/phases/00-setup-and-tooling/05-jupyter-notebooks/docs/en.md index e8a0bd99f..982de5ec2 100644 --- a/phases/00-setup-and-tooling/05-jupyter-notebooks/docs/en.md +++ b/phases/00-setup-and-tooling/05-jupyter-notebooks/docs/en.md @@ -173,10 +173,18 @@ plt.show() The plot appears right below the cell. This is why notebooks dominate AI work. You see the data, the plot, and the code together. -For images: +For images, make sure the file exists before displaying it. This example creates a small placeholder image first: ```python +import matplotlib.pyplot as plt from IPython.display import Image, display + +plt.figure(figsize=(6, 3)) +plt.text(0.5, 0.5, "Architecture Diagram", ha="center", va="center", fontsize=18) +plt.axis("off") +plt.savefig("architecture.png", bbox_inches="tight", dpi=150) +plt.close() + display(Image(filename="architecture.png")) ```