Skip to content

Commit a5a0adc

Browse files
committed
Get rid of the mpl_examples symlink.
1 parent a5ba245 commit a5a0adc

File tree

6 files changed

+11
-29
lines changed

6 files changed

+11
-29
lines changed

doc/README.txt

-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@ python documentation system built on top of ReST. This directory contains
3636
* _templates - used by the sphinx build system
3737

3838
* sphinxext - Sphinx extensions for the mpl docs
39-
40-
* mpl_examples - a link to the Matplotlib examples in case any
41-
documentation wants to literal include them

doc/devel/documenting_mpl.rst

+8-22
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,14 @@ It is not necessary to explicitly save the figure from the script; this will be
327327
done automatically when the docs are built to ensure that the code that is
328328
included runs and produces the advertised figure.
329329
330-
There are two options for where to put the code that generates a figure. If
331-
you want to include a plot in the examples gallery, the code should be added to
332-
the :file:`examples` directory. Plots from
333-
the :file:`examples` directory can then be referenced through the symlink
334-
``mpl_examples`` in the ``doc`` directory, e.g.:
330+
There are two options for where to put the code that generates a figure. If you
331+
want to include a plot in the examples gallery, the code should be added to the
332+
:file:`examples` directory. Plots from the :file:`examples` directory can then
333+
be referenced through the ``gallery`` directory set up by sphinx-gallery ::
335334
336335
.. code-block:: rst
337336
338-
.. plot:: mpl_examples/lines_bars_and_markers/fill.py
337+
.. plot:: gallery/lines_bars_and_markers/fill.py
339338
340339
Alternatively the plotting code can be placed directly in the docstring.
341340
To include plots directly in docstrings, see the following guide:
@@ -404,25 +403,12 @@ from :file:`customizing.rst`::
404403
405404
.. literalinclude:: ../../lib/matplotlib/mpl-data/matplotlibrc
406405
407-
One exception to this is when referring to the examples directory. Relative
408-
paths are extremely confusing in the sphinx plot extensions, so it is easier
409-
to simply include a symlink to the files at the top doc level directory.
410-
This way, API documents like :meth:`matplotlib.pyplot.plot` can refer to the
411-
examples in a known location.
412-
413-
In the top level :file:`doc` directory we have symlinks pointing to the
414-
Matplotlib :file:`examples`:
415-
416-
.. code-block:: sh
417-
418-
home:~/mpl/doc> ls -l mpl_*
419-
mpl_examples -> ../examples
420-
421-
So we can include plots from the examples dir using the symlink:
406+
The examples directory is also copied to :file:`doc/gallery` by sphinx-gallery,
407+
so we can include plots from the examples dir using
422408
423409
.. code-block:: rst
424410
425-
.. plot:: mpl_examples/pylab_examples/simple_plot.py
411+
.. plot:: gallery/pylab_examples/simple_plot.py
426412
427413
.. _internal-section-refs:
428414

doc/mpl_examples

-1
This file was deleted.

lib/matplotlib/axes/_axes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
11511151
Examples
11521152
--------
11531153
1154-
.. plot:: mpl_examples/lines_bars_and_markers/eventplot_demo.py
1154+
.. plot:: gallery/lines_bars_and_markers/eventplot_demo.py
11551155
"""
11561156
self._process_unit_info(xdata=positions,
11571157
ydata=[lineoffsets, linelengths],

lib/matplotlib/collections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ def __init__(self,
13921392
Examples
13931393
--------
13941394
1395-
.. plot:: mpl_examples/lines_bars_and_markers/eventcollection_demo.py
1395+
.. plot:: gallery/lines_bars_and_markers/eventcollection_demo.py
13961396
"""
13971397

13981398
segment = (lineoffset + linelength / 2.,

pytest.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[pytest]
2-
norecursedirs = .git build ci dist doc extern lib/mpl_examples release unit venv
2+
testpaths = lib
33
python_files = test_*.py
44

55
markers =

0 commit comments

Comments
 (0)