From 46fcc345852689649a1756aa8650ef307239e0e9 Mon Sep 17 00:00:00 2001 From: Eduardo Patrocinio Date: Wed, 10 Dec 2025 17:17:55 -0500 Subject: [PATCH] Fix plt.show() display issue in data_tutorial.py Add plt.axis('off') before plt.show() to ensure the plot displays correctly in environments like Windows 11 with WSL and PyCharm Pro. This is a known matplotlib issue where an explicit axis operation is needed to trigger the display properly. The axis('off') call also improves the visualization by hiding the axis ticks and labels, making the image cleaner. Fixes #3497 --- beginner_source/basics/data_tutorial.py | 1 + 1 file changed, 1 insertion(+) diff --git a/beginner_source/basics/data_tutorial.py b/beginner_source/basics/data_tutorial.py index 2c46b33122a..53d481644bc 100644 --- a/beginner_source/basics/data_tutorial.py +++ b/beginner_source/basics/data_tutorial.py @@ -234,6 +234,7 @@ def __getitem__(self, idx): img = train_features[0].squeeze() label = train_labels[0] plt.imshow(img, cmap="gray") +plt.axis("off") plt.show() print(f"Label: {label}")