From ce1da9ee3b41676baf2ba3d6587104aa23216fcd Mon Sep 17 00:00:00 2001 From: David Stansby Date: Tue, 30 May 2023 10:58:23 +0100 Subject: [PATCH] Improve name and doc of base widget --- src/napari_matplotlib/base.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/napari_matplotlib/base.py b/src/napari_matplotlib/base.py index 6d18fc64..4232cf71 100644 --- a/src/napari_matplotlib/base.py +++ b/src/napari_matplotlib/base.py @@ -17,15 +17,16 @@ # Icons modified from # https://github.com/matplotlib/matplotlib/tree/main/lib/matplotlib/mpl-data/images ICON_ROOT = Path(__file__).parent / "icons" -__all__ = ["MPLWidget", "NapariMPLWidget"] +__all__ = ["BaseNapariMPLWidget", "NapariMPLWidget"] -class MPLWidget(QWidget): +class BaseNapariMPLWidget(QWidget): """ - Widget containing a Matplotlib canvas and toolbar. + Widget containing Matplotlib canvas and toolbar themed to match napari. This creates a single FigureCanvas, which contains a single - `~matplotlib.figure.Figure`, and an associated toolbar. + `~matplotlib.figure.Figure`, and an associated toolbar. Both of these + are customised to match the visual style of the main napari window. It is not responsible for creating any Axes, because different widgets may want to implement different subplot layouts. """ @@ -99,7 +100,7 @@ def _replace_toolbar_icons(self) -> None: action.setIcon(QIcon(icon_path)) -class NapariMPLWidget(MPLWidget): +class NapariMPLWidget(BaseNapariMPLWidget): """ Widget containing a Matplotlib canvas and toolbar.