Closed kconnour closed 2 years ago
I'd also like to include pyplots. numpy and scipy seem to have figured out that one too but I haven't yet.
I have a solution for the pyplots (this is mostly a note to myself). conf.py must include
import matplotlib
and extensions must include to plot directive like so:
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'matplotlib.sphinxext.mathmpl',
'matplotlib.sphinxext.plot_directive'
]
Then I can include plot directives anywhere with:
.. plot::
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 2*np.pi)
plt.plot(x, np.sin(x))
plt.show()
See this link for more info: https://matplotlib.org/sampledoc/extensions.html
This will be addressed in the next update
Feature request: the "source" button at the function / class signature links to a rtd themed version of the code. It'd be great to link to the actual code on Github instead.
I tried to implement this but failed. However it appears that numpy was able to do this in their current version (v 1.21) of their docs.