From e9226ecca10638f39144b820d0d0e0c1bef6bb2d Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 23 Sep 2022 02:45:08 -0400 Subject: [PATCH] Backport PR #23978: DOC: Suppress IPython output in examples and tutorials where not needed --- doc/conf.py | 1 + tutorials/intermediate/artists.py | 1 + tutorials/intermediate/autoscale.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 112d9fdaf22c..5aa58a3aca5a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -198,6 +198,7 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf, 'subsection_order': gallery_order.sectionorder, 'thumbnail_size': (320, 224), 'within_subsection_order': gallery_order.subsectionorder, + 'capture_repr': (), } mathmpl_fontsize = 11.0 diff --git a/tutorials/intermediate/artists.py b/tutorials/intermediate/artists.py index f76c62d8462c..22793ddd5fd0 100644 --- a/tutorials/intermediate/artists.py +++ b/tutorials/intermediate/artists.py @@ -115,6 +115,7 @@ class in the Matplotlib API, and the one you will be working with most Try creating the figure below. """ +# sphinx_gallery_capture_repr = ('__repr__',) import numpy as np import matplotlib.pyplot as plt diff --git a/tutorials/intermediate/autoscale.py b/tutorials/intermediate/autoscale.py index 0f4dda87d183..3b563510aa1f 100644 --- a/tutorials/intermediate/autoscale.py +++ b/tutorials/intermediate/autoscale.py @@ -26,7 +26,7 @@ # ------- # The default margin around the data limits is 5%: -ax.margins() +print(ax.margins()) ############################################################################### # The margins can be made larger using `~matplotlib.axes.Axes.margins`: