Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: enable matplotlib plot_directive to include figures in docstrings #20015

Merged
merged 2 commits into from Mar 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -63,6 +63,7 @@
'ipython_sphinxext.ipython_console_highlighting',
# lowercase didn't work
'IPython.sphinxext.ipython_console_highlighting',
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
@@ -85,6 +86,14 @@
if any(re.match("\s*api\s*", l) for l in index_rst_lines):
autosummary_generate = True

# matplotlib plot directive
plot_include_source = True
plot_formats = [("png", 90)]
plot_html_show_formats = False
plot_html_show_source_link = False
plot_pre_code = """import numpy as np
import pandas as pd"""

# Add any paths that contain templates here, relative to this directory.
templates_path = ['../_templates']

@@ -2537,6 +2537,15 @@ def line(self, **kwds):
Returns
-------
axes : matplotlib.AxesSubplot or np.array of them
Examples
--------
.. plot::
:context: close-figs
>>> s = pd.Series([1, 3, 2])
>>> s.plot.line()
"""
return self(kind='line', **kwds)