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

Skip to content

Commit 7ceea9e

Browse files
committed
Change plot_dir_resolve_method to plot_path_resolution_method
1 parent 2b81c12 commit 7ceea9e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

doc/api/next_api_changes/2018-10-09-plot-directive.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ files in the host system.
2121
Since this will break documentations that were depending on the old behavior,
2222
there is a deprecation period and a new configuration option is introduced to
2323
get the old behavior. To get the old behavior specify
24-
``plot_dir_resolve_method='absolute'`` in ``conf.py`` and specify
25-
``plot_dir_resolve_method='relative'`` to get the new behavior. The old
26-
behavior might be removed in future. The users are advised to switch to the new
24+
``plot_path_resolution_method='old'`` in ``conf.py`` and specify
25+
``plot_path_resolution_method='relative'`` to get the new behavior. The old
26+
behavior will be removed in future. The users are advised to switch to the new
2727
behavior and fix the plot directives accordingly.

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,26 @@
100100
import numpy as np
101101
from matplotlib import pyplot as plt
102102
103-
plot_dir_resolve_method
103+
plot_path_resolution_method
104104
The method to use for resolving file names that come after the
105105
``plot::`` directive. Two options are available: ``relative`` and
106-
``absolute``. Defaults to ``absolute`` but the default value will
107-
change to ``relative`` in future versions. The ``absolute`` method
108-
is deprecated and might be removed in future. See the ``plot_basedir``
106+
``old``. Defaults to ``old`` but the default value will
107+
change to ``relative`` in future versions. The ``old`` method
108+
is deprecated and will be removed in future. See the ``plot_basedir``
109109
for explanation of methods.
110110
111111
plot_basedir
112112
Base directory, to which ``plot::`` file names are relative.
113113
Defaults to the source directory.
114114
115-
If ``plot_dir_resolve_method`` is ``relative``, relative file names are
116-
found relative to the directory of the file containing the directive.
117-
Absolute file names (paths starting with ``/``) are found relative to
118-
``plot_basedir``.
115+
If ``plot_path_resolution_method`` is ``relative``, relative file names
116+
are found relative to the directory of the file containing the
117+
directive. Absolute file names (paths starting with ``/``) are found
118+
relative to ``plot_basedir``.
119119
120-
If ``plot_dir_resolve_method`` is ``absolute``, all files are found
121-
relative to ``plot_basedir`` whether the paths start with ``/`` or not.
122-
This method is deprecated and may be removed in future.
120+
If ``plot_path_resolution_method`` is ``old``, relative paths are found
121+
relative to ``plot_basedir`` and absolute paths point to files in the
122+
host system. This method is deprecated and will be removed in future.
123123
124124
plot_formats
125125
File formats to generate. List of tuples or strings::
@@ -687,7 +687,7 @@ def run(arguments, content, options, state_machine, state, lineno):
687687
if len(arguments):
688688

689689
# if the new method is selected for resolving paths
690-
if config.plot_dir_resolve_method.lower() == 'relative':
690+
if config.plot_path_resolution_method.lower() == 'relative':
691691

692692
if arguments[0].startswith('/'):
693693
arguments[0] = arguments[0][1:]
@@ -703,7 +703,7 @@ def run(arguments, content, options, state_machine, state, lineno):
703703
'3.2', message='You are using an old method '
704704
'to resolve filenames of the ``.. ::plot`` directive. Please '
705705
'switch to the new method by specifying '
706-
'``plot_dir_resolve_method=\'relative\'`` in your conf.py '
706+
'``plot_path_resolution_method=\'relative\'`` in your conf.py '
707707
'and fix the filenames accordingly. Please see '
708708
'matplotlib/doc/api/next_api_changes/2018-10-09-plot-directive.rst '
709709
'for more information. The old method will be removed in '

0 commit comments

Comments
 (0)