From 76153d8edef07dd87da678408491e88de5654b69 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 15 Oct 2017 21:17:03 -0700 Subject: [PATCH] Minor fixes to gallery build. 1. Do not call `matplotlib.use("svg")` in the svg-specific examples, as this is unneeded (matplotlib will internally switch the canvas at save time) and triggers a warning because s-g already set the canvas to agg. 2. Do not report computation times for examples than ran faster than 1s (i.e., most of them) -- for fast examples, we are timing and reporting noise. 3. Some markup fixes. --- doc/conf.py | 3 ++- examples/misc/svg_filter_line.py | 3 --- examples/misc/svg_filter_pie.py | 4 ---- examples/subplots_axes_and_figures/subplots_adjust.py | 3 ++- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 83e26a0f8f5f..5e22f3ef299d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -132,7 +132,8 @@ def _check_deps(): 'scipy': 'https://docs.scipy.org/doc/scipy/reference', }, 'backreferences_dir': 'api/_as_gen', - 'subsection_order': ExplicitOrder(explicit_order_folders) + 'subsection_order': ExplicitOrder(explicit_order_folders), + 'min_reported_time': 1, } plot_gallery = 'True' diff --git a/examples/misc/svg_filter_line.py b/examples/misc/svg_filter_line.py index 941642ef4e2b..aaef954dd7ba 100644 --- a/examples/misc/svg_filter_line.py +++ b/examples/misc/svg_filter_line.py @@ -10,9 +10,6 @@ """ from __future__ import print_function -import matplotlib - -matplotlib.use("Svg") import matplotlib.pyplot as plt import matplotlib.transforms as mtransforms diff --git a/examples/misc/svg_filter_pie.py b/examples/misc/svg_filter_pie.py index 216533685a87..47f24b7595a9 100644 --- a/examples/misc/svg_filter_pie.py +++ b/examples/misc/svg_filter_pie.py @@ -10,10 +10,6 @@ support it. """ - -import matplotlib -matplotlib.use("Svg") - import matplotlib.pyplot as plt from matplotlib.patches import Shadow diff --git a/examples/subplots_axes_and_figures/subplots_adjust.py b/examples/subplots_axes_and_figures/subplots_adjust.py index 8f3f8faf0f91..ec5623a59fae 100644 --- a/examples/subplots_axes_and_figures/subplots_adjust.py +++ b/examples/subplots_axes_and_figures/subplots_adjust.py @@ -3,7 +3,8 @@ Subplots Adjust =============== -Adjusting the spacing of margins and subplots using :func:~matplotlib.pyplot.subplots_adjust. +Adjusting the spacing of margins and subplots using +`~matplotlib.pyplot.subplots_adjust`. """ import matplotlib.pyplot as plt import numpy as np