Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6a2844

Browse files
committed
revert r8445,8446 and fix plot_directive.py to support sphinx 1.0
svn path=/trunk/matplotlib/; revision=8447
1 parent 61f25e5 commit a6a2844

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

doc/faq/howto_faq.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ Here is that gets a bounding box in relative figure coordinates (0..1)
178178
of each of the labels and uses it to move the left of the subplots
179179
over so that the tick labels fit in the figure
180180

181+
.. plot:: pyplots/auto_subplots_adjust.py
182+
:include-source:
183+
181184
.. _howto-ticks:
182185

183186
Configure the tick linewidths
@@ -218,6 +221,9 @@ behavior by specifying the coordinates of the label. The example
218221
below shows the default behavior in the left subplots, and the manual
219222
setting in the right subplots.
220223

224+
.. plot:: pyplots/align_ylabels.py
225+
:include-source:
226+
221227
.. _date-index-plots:
222228

223229
Skip dates where there is no data

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,13 @@ def _plot_directive(plot_path, basedir, function_name, plot_code, caption,
366366

367367
if options.has_key('include-source'):
368368
if plot_code is None:
369+
if sphinx_version > (1,):
370+
include_prefix = '/'
371+
else:
372+
include_prefix = setup.app.builder.srcdir
373+
369374
lines.extend(
370-
['.. include:: %s' % os.path.join(setup.app.builder.srcdir, plot_path),
375+
['.. include:: %s' % os.path.join(include_prefix, plot_path),
371376
' :literal:'])
372377
if options.has_key('encoding'):
373378
lines.append(' :encoding: %s' % options['encoding'])

0 commit comments

Comments
 (0)