From c85d69c7f07154c82be15be24a56ed134463555e Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Tue, 3 Oct 2017 09:10:00 -0700 Subject: [PATCH] Backport PR #9272: Include the default of "plot_pre_code" of the plot directive in the documentation --- lib/matplotlib/sphinxext/plot_directive.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 1e92f5a29814..795c39daac73 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -90,7 +90,11 @@ Whether to show a link to the source in HTML. plot_pre_code - Code that should be executed before each plot. + Code that should be executed before each plot. If not specified or None + it will default to a string containing:: + + import numpy as np + from matplotlib import pyplot as plt plot_basedir Base directory, to which ``plot::`` file names are relative