File tree Expand file tree Collapse file tree 8 files changed +74
-30
lines changed
Expand file tree Collapse file tree 8 files changed +74
-30
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ instance/
6060# Sphinx documentation
6161docs /_build /
6262docs /auto_examples
63+ docs /api
6364
6465# MkDocs documentation
6566/site /
Original file line number Diff line number Diff line change 1+ API reference
2+ =============
3+ This section documents the internal API of ``napari-matplotlib `` classes.
4+ Most users shouldn't need this, and will just directly interact with the
5+ plots though the napari user interface.
6+
7+
8+ .. automodapi :: napari_matplotlib
9+
10+ .. automodapi :: napari_matplotlib.base
Original file line number Diff line number Diff line change 1+ HistogramWidget
2+ ===============
3+
4+ .. currentmodule :: napari_matplotlib
5+
6+ .. autoclass :: HistogramWidget
7+ :show-inheritance:
8+
9+ .. rubric :: Methods Summary
10+
11+ .. autosummary ::
12+
13+ ~HistogramWidget.hist_current_layer
14+ ~HistogramWidget.update_layer
15+
16+ .. rubric :: Methods Documentation
17+
18+ .. automethod :: hist_current_layer
19+ .. automethod :: update_layer
Original file line number Diff line number Diff line change 2727# Add any Sphinx extension module names here, as strings. They can be
2828# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929# ones.
30- extensions = ["sphinx_gallery.gen_gallery" ]
30+ extensions = [
31+ "numpydoc" ,
32+ "sphinx_gallery.gen_gallery" ,
33+ "sphinx_automodapi.automodapi" ,
34+ ]
3135
3236sphinx_gallery_conf = {
3337 "filename_pattern" : "." ,
3438 "image_scrapers" : (qtgallery .qtscraper ,),
3539 "reset_modules" : (qtgallery .reset_qapp ,),
3640}
3741
42+ numpydoc_show_class_members = False
43+
3844# Add any paths that contain templates here, relative to this directory.
3945templates_path = ["_templates" ]
4046
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Welcome to matplotlib-napari's documentation!
1111 :caption: Contents:
1212
1313 auto_examples/index
14+ api
1415
1516
1617
Original file line number Diff line number Diff line change @@ -49,9 +49,11 @@ napari.manifest =
4949
5050[options.extras_require]
5151docs =
52+ numpydoc
5253 pydata-sphinx-theme
5354 qtgallery
5455 sphinx
56+ sphinx-automodapi
5557 sphinx-gallery
5658testing =
5759 napari[pyqt5]
Original file line number Diff line number Diff line change 11import napari
22import numpy as np
3- from matplotlib .backends .backend_qt5agg import FigureCanvas
4- from matplotlib .figure import Figure
5- from qtpy .QtWidgets import QVBoxLayout , QWidget
6-
7- __all__ = ["HistogramWidget" ]
83
4+ from .base import NapariMPLWidget
95
10- class NapariMPLWidget (QWidget ):
11- """
12- Attributes
13- ----------
14- viewer : napari.viewer.Viewer
15- Main napari viewer.
16- figure : matplotlib.figure.Figure
17- Matplotlib figure.
18- canvas : matplotlib.backends.backend_qt5agg.FigureCanvas
19- Matplotlib canvas.
20- axes : matplotlib.axes.Axes
21- Matplotlib axes.
22- """
23-
24- def __init__ (self , napari_viewer : napari .viewer .Viewer ):
25- super ().__init__ ()
26-
27- self .viewer = napari_viewer
28- self .figure = Figure (figsize = (5 , 3 ), tight_layout = True )
29- self .canvas = FigureCanvas (self .figure )
30- self .axes = self .canvas .figure .subplots ()
31-
32- self .setLayout (QVBoxLayout ())
33- self .layout ().addWidget (self .canvas )
6+ __all__ = ["HistogramWidget" ]
347
358
369class HistogramWidget (NapariMPLWidget ):
Original file line number Diff line number Diff line change 1+ import napari
2+ from matplotlib .backends .backend_qt5agg import FigureCanvas
3+ from matplotlib .figure import Figure
4+ from qtpy .QtWidgets import QVBoxLayout , QWidget
5+
6+ __all__ = ["NapariMPLWidget" ]
7+
8+
9+ class NapariMPLWidget (QWidget ):
10+ """
11+ Attributes
12+ ----------
13+ viewer : napari.viewer.Viewer
14+ Main napari viewer.
15+ figure : matplotlib.figure.Figure
16+ Matplotlib figure.
17+ canvas : matplotlib.backends.backend_qt5agg.FigureCanvas
18+ Matplotlib canvas.
19+ axes : matplotlib.axes.Axes
20+ Matplotlib axes.
21+ """
22+
23+ def __init__ (self , napari_viewer : napari .viewer .Viewer ):
24+ super ().__init__ ()
25+
26+ self .viewer = napari_viewer
27+ self .figure = Figure (figsize = (5 , 3 ), tight_layout = True )
28+ self .canvas = FigureCanvas (self .figure )
29+ self .axes = self .canvas .figure .subplots ()
30+
31+ self .setLayout (QVBoxLayout ())
32+ self .layout ().addWidget (self .canvas )
You can’t perform that action at this time.
0 commit comments