Skip to content

Commit fc277da

Browse files
committed
add printed tabular table
1 parent aa56c83 commit fc277da

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

docs/source/tutorials_source/devtools-integration-tutorial.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def forward(self, x):
189189

190190
# sphinx_gallery_start_ignore
191191
inspector_patch = patch.object(Inspector, "__init__", return_value=None)
192-
inspector_patch_print = patch.object(Inspector, "print_data_tabular", return_value="")
192+
inspector_patch_print = patch.object(Inspector, "print_data_tabular", return_value=None)
193193
inspector_patch.start()
194194
inspector_patch_print.start()
195195
# sphinx_gallery_end_ignore
@@ -201,6 +201,19 @@ def forward(self, x):
201201
# sphinx_gallery_end_ignore
202202
inspector.print_data_tabular()
203203

204+
# sphinx_gallery_start_ignore
205+
# Display the actural inspector tabular table image
206+
import matplotlib.image as mpimg
207+
import matplotlib.pyplot as plt
208+
209+
# Load and display the image
210+
img = mpimg.imread("tabular_result.png")
211+
fig, ax = plt.subplots(figsize=(8, 6), dpi=150) # Adjust figsize and dpi as needed
212+
ax.imshow(img)
213+
ax.axis("off") # Hide axes
214+
plt.show()
215+
# sphinx_gallery_end_ignore
216+
204217
# sphinx_gallery_start_ignore
205218
inspector_patch.stop()
206219
inspector_patch_print.stop()
789 KB
Loading

0 commit comments

Comments
 (0)