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

Skip to content

Commit bd024b8

Browse files
authored
sphinx plot directive: sources relative to rst file
According to the documentation when plot_basedir is empty or None. The source-code files are found relative to the document that contains them. However, this was not true in the actual implementation. Fixes #10350
1 parent f93222a commit bd024b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ def run(arguments, content, options, state_machine, state, lineno):
647647

648648
if len(arguments):
649649
if not config.plot_basedir:
650-
source_file_name = os.path.join(setup.app.builder.srcdir,
650+
source_file_name = os.path.join(rst_dir,
651651
directives.uri(arguments[0]))
652652
else:
653653
source_file_name = os.path.join(setup.confdir, config.plot_basedir,

0 commit comments

Comments
 (0)