diff --git a/doc/api/toolkits/axisartist.rst b/doc/api/toolkits/axisartist.rst index 5f58d134d370..2dec9cafa01d 100644 --- a/doc/api/toolkits/axisartist.rst +++ b/doc/api/toolkits/axisartist.rst @@ -4,7 +4,7 @@ =========================== The *axisartist* namespace provides a derived Axes implementation -(:class:`mpl_toolkits.axisartist.Axes`), designed to support curvilinear +(:class:`~mpl_toolkits.axisartist.axislines.Axes`), designed to support curvilinear grids. The biggest difference is that the artists that are responsible for drawing axis lines, ticks, ticklabels, and axis labels are separated out from Matplotlib's Axis class. diff --git a/doc/api/toolkits/mplot3d.rst b/doc/api/toolkits/mplot3d.rst index 0d860bd2cfea..4810bb742bd2 100644 --- a/doc/api/toolkits/mplot3d.rst +++ b/doc/api/toolkits/mplot3d.rst @@ -63,7 +63,7 @@ the toolbar pan and zoom buttons are not used. =================================== .. note:: - See :attr:`mpl_toolkits.mplot3d.axis3d._axinfo` for a dictionary containing + See :attr:`!mpl_toolkits.mplot3d.axis3d._axinfo` for a dictionary containing constants that may be modified for controlling the look and feel of mplot3d axes (e.g., label spacing, font colors and panel colors). Historically, axis3d has suffered from having hard-coded constants diff --git a/doc/missing-references.json b/doc/missing-references.json index 61662066f639..65241446f02c 100644 --- a/doc/missing-references.json +++ b/doc/missing-references.json @@ -1,117 +1,4 @@ { - "py:attr": { - "cbar_axes": [ - "lib/mpl_toolkits/axes_grid1/axes_grid.py:docstring of mpl_toolkits.axes_grid1.axes_grid.ImageGrid:72" - ], - "eventson": [ - "lib/matplotlib/widgets.py:docstring of matplotlib.widgets.CheckButtons.set_active:4", - "lib/matplotlib/widgets.py:docstring of matplotlib.widgets.RadioButtons.set_active:4" - ], - "fmt_zdata": [ - "lib/mpl_toolkits/mplot3d/axes3d.py:docstring of mpl_toolkits.mplot3d.axes3d.Axes3D.format_zdata:2" - ], - "height": [ - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.Bbox.bounds:2" - ], - "input_dims": [ - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.AitoffAxes.AitoffTransform.transform_non_affine:14", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.AitoffAxes.InvertedAitoffTransform.transform_non_affine:14", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.HammerAxes.HammerTransform.transform_non_affine:14", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.HammerAxes.InvertedHammerTransform.transform_non_affine:14", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.LambertAxes.InvertedLambertTransform.transform_non_affine:14", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.LambertAxes.LambertTransform.transform_non_affine:14", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.MollweideAxes.InvertedMollweideTransform.transform_non_affine:14", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.MollweideAxes.MollweideTransform.transform_non_affine:14", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.AffineBase.transform:8", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.AffineBase.transform_affine:15", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.AffineBase.transform_non_affine:14", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.CompositeGenericTransform.transform_affine:15", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.CompositeGenericTransform.transform_non_affine:14", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.IdentityTransform.transform:8", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.IdentityTransform.transform_affine:15", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.IdentityTransform.transform_non_affine:14" - ], - "lines": [ - "lib/matplotlib/colorbar.py:docstring of matplotlib.colorbar.Colorbar.add_lines:4" - ], - "matplotlib.axes.Axes.patch": [ - "doc/tutorials/artists.rst:185", - "doc/tutorials/artists.rst:424" - ], - "matplotlib.axes.Axes.patches": [ - "doc/tutorials/artists.rst:462" - ], - "matplotlib.axes.Axes.transAxes": [ - "lib/mpl_toolkits/axes_grid1/anchored_artists.py:docstring of mpl_toolkits.axes_grid1.anchored_artists.AnchoredDirectionArrows:8" - ], - "matplotlib.axes.Axes.transData": [ - "lib/mpl_toolkits/axes_grid1/anchored_artists.py:docstring of mpl_toolkits.axes_grid1.anchored_artists.AnchoredAuxTransformBox:11", - "lib/mpl_toolkits/axes_grid1/anchored_artists.py:docstring of mpl_toolkits.axes_grid1.anchored_artists.AnchoredSizeBar:8" - ], - "matplotlib.axes.Axes.xaxis": [ - "doc/tutorials/artists.rst:608", - "doc/users/explain/axes/axes_intro.rst:133" - ], - "matplotlib.axes.Axes.yaxis": [ - "doc/tutorials/artists.rst:608", - "doc/users/explain/axes/axes_intro.rst:133" - ], - "matplotlib.figure.Figure.patch": [ - "doc/tutorials/artists.rst:185", - "doc/tutorials/artists.rst:318" - ], - "matplotlib.figure.Figure.transFigure": [ - "doc/tutorials/artists.rst:367" - ], - "max": [ - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.Bbox.p1:4" - ], - "min": [ - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.Bbox.p0:4" - ], - "mpl_toolkits.mplot3d.axis3d._axinfo": [ - "doc/api/toolkits/mplot3d.rst:66" - ], - "name": [ - "lib/matplotlib/scale.py:docstring of matplotlib.scale.ScaleBase:8" - ], - "output_dims": [ - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.AitoffAxes.AitoffTransform.transform_non_affine:22", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.AitoffAxes.InvertedAitoffTransform.transform_non_affine:22", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.HammerAxes.HammerTransform.transform_non_affine:22", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.HammerAxes.InvertedHammerTransform.transform_non_affine:22", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.LambertAxes.InvertedLambertTransform.transform_non_affine:22", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.LambertAxes.LambertTransform.transform_non_affine:22", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.MollweideAxes.InvertedMollweideTransform.transform_non_affine:22", - "lib/matplotlib/projections/geo.py:docstring of matplotlib.projections.geo.MollweideAxes.MollweideTransform.transform_non_affine:22", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.AffineBase.transform:16", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.AffineBase.transform_affine:23", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.AffineBase.transform_non_affine:22", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.CompositeGenericTransform.transform_affine:23", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.CompositeGenericTransform.transform_non_affine:22", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.IdentityTransform.transform:16", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.IdentityTransform.transform_affine:23", - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.IdentityTransform.transform_non_affine:22" - ], - "triangulation": [ - "lib/matplotlib/tri/_trirefine.py:docstring of matplotlib.tri._trirefine.UniformTriRefiner.refine_triangulation:2" - ], - "width": [ - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.Bbox.bounds:2" - ], - "xmax": [ - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.Bbox.x1:4" - ], - "xmin": [ - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.Bbox.x0:4" - ], - "ymax": [ - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.Bbox.y1:4" - ], - "ymin": [ - "lib/matplotlib/transforms.py:docstring of matplotlib.transforms.Bbox.y0:4" - ] - }, "py:class": { "HashableList[_HT]": [ ":1" @@ -119,15 +6,6 @@ "matplotlib.axes._base._AxesBase": [ "doc/api/artist_api.rst:202" ], - "matplotlib.backend_bases.FigureCanvas": [ - "doc/tutorials/artists.rst:33", - "doc/tutorials/artists.rst:35", - "doc/tutorials/artists.rst:40" - ], - "matplotlib.backend_bases.Renderer": [ - "doc/tutorials/artists.rst:35", - "doc/tutorials/artists.rst:40" - ], "matplotlib.backend_bases._Backend": [ "lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.ShowBase:1" ], @@ -234,9 +112,6 @@ ":1", "doc/api/_as_gen/mpl_toolkits.axes_grid1.parasite_axes.rst:30::1" ], - "mpl_toolkits.axisartist.Axes": [ - "doc/api/toolkits/axisartist.rst:6" - ], "mpl_toolkits.axisartist.axisline_style.AxislineStyle._Base": [ "lib/mpl_toolkits/axisartist/axisline_style.py:docstring of mpl_toolkits.axisartist.axisline_style.AxislineStyle.SimpleArrow:1" ], @@ -267,32 +142,7 @@ ":1" ] }, - "py:data": { - "matplotlib.axes.Axes.transAxes": [ - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.legend:250", - "lib/matplotlib/figure.py:docstring of matplotlib.figure.FigureBase.legend:251", - "lib/matplotlib/legend.py:docstring of matplotlib.legend.Legend:209", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.figlegend:251", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.legend:250" - ] - }, "py:meth": { - "AbstractPathEffect._update_gc": [ - "lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.SimpleLineShadow:44", - "lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.SimplePatchShadow:42", - "lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.TickedStroke:57", - "lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.withSimplePatchShadow:51", - "lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.withTickedStroke:56" - ], - "IPython.terminal.interactiveshell.TerminalInteractiveShell.inputhook": [ - "doc/users/explain/figure/interactive_guide.rst:420" - ], - "_find_tails": [ - "lib/matplotlib/quiver.py:docstring of matplotlib.quiver.Barbs:9" - ], - "_make_barbs": [ - "lib/matplotlib/quiver.py:docstring of matplotlib.quiver.Barbs:9" - ], "matplotlib.collections._CollectionWithSizes.set_sizes": [ "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.barbs:180", "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.broken_barh:85", @@ -331,88 +181,12 @@ ] }, "py:obj": { - "Artist.stale_callback": [ - "doc/users/explain/figure/interactive_guide.rst:323" - ], - "Figure.stale_callback": [ - "doc/users/explain/figure/interactive_guide.rst:333" - ], "Image": [ "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.gci:4" ], - "Line2D.pick": [ - "doc/users/explain/figure/event_handling.rst:571" - ], - "Rectangle.contains": [ - "doc/users/explain/figure/event_handling.rst:285" - ], - "Size.from_any": [ - "lib/mpl_toolkits/axes_grid1/axes_grid.py:docstring of mpl_toolkits.axes_grid1.axes_grid.ImageGrid:87" - ], - "Timer": [ - "lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.FigureCanvasBase.new_timer:2", - "lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.TimerBase:14" - ], - "ToolContainer": [ - "lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.ToolContainerBase.remove_toolitem:8", - "lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.ToolContainerBase:9" - ], - "_iter_collection": [ - "lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.RendererBase.draw_path_collection:15", - "lib/matplotlib/backends/backend_pdf.py:docstring of matplotlib.backends.backend_pdf.RendererPdf.draw_path_collection:15", - "lib/matplotlib/backends/backend_ps.py:docstring of matplotlib.backends.backend_ps.RendererPS.draw_path_collection:15", - "lib/matplotlib/backends/backend_svg.py:docstring of matplotlib.backends.backend_svg.RendererSVG.draw_path_collection:15", - "lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.PathEffectRenderer.draw_path_collection:15" - ], - "_iter_collection_raw_paths": [ - "lib/matplotlib/backend_bases.py:docstring of matplotlib.backend_bases.RendererBase.draw_path_collection:15", - "lib/matplotlib/backends/backend_pdf.py:docstring of matplotlib.backends.backend_pdf.RendererPdf.draw_path_collection:15", - "lib/matplotlib/backends/backend_ps.py:docstring of matplotlib.backends.backend_ps.RendererPS.draw_path_collection:15", - "lib/matplotlib/backends/backend_svg.py:docstring of matplotlib.backends.backend_svg.RendererSVG.draw_path_collection:15", - "lib/matplotlib/patheffects.py:docstring of matplotlib.patheffects.PathEffectRenderer.draw_path_collection:15" - ], - "_read": [ - "lib/matplotlib/dviread.py:docstring of matplotlib.dviread.Vf:22" - ], "active": [ "lib/matplotlib/widgets.py:docstring of matplotlib.widgets.AxesWidget:21" ], - "ax.transAxes": [ - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.inset_axes:11" - ], - "can_composite": [ - "lib/matplotlib/image.py:docstring of matplotlib.image.composite_images:9" - ], - "converter": [ - "lib/matplotlib/testing/compare.py:docstring of matplotlib.testing.compare.compare_images:4" - ], - "draw_image": [ - "lib/matplotlib/backends/backend_agg.py:docstring of matplotlib.backends.backend_agg.RendererAgg.option_scale_image:2" - ], - "fmt_xdata": [ - "lib/matplotlib/axes/_base.py:docstring of matplotlib.axes._base._AxesBase.format_xdata:4" - ], - "fmt_ydata": [ - "lib/matplotlib/axes/_base.py:docstring of matplotlib.axes._base._AxesBase.format_ydata:4" - ], - "get_size": [ - "lib/mpl_toolkits/axes_grid1/axes_size.py:docstring of mpl_toolkits.axes_grid1.axes_size:1" - ], - "ipykernel.pylab.backend_inline": [ - "doc/users/explain/figure/interactive.rst:361" - ], - "kde.covariance_factor": [ - "lib/matplotlib/mlab.py:docstring of matplotlib.mlab.GaussianKDE:29" - ], - "kde.factor": [ - "lib/matplotlib/axes/_axes.py:docstring of matplotlib.axes._axes.Axes.violinplot:58", - "lib/matplotlib/mlab.py:docstring of matplotlib.mlab.GaussianKDE:12", - "lib/matplotlib/mlab.py:docstring of matplotlib.mlab.GaussianKDE:33", - "lib/matplotlib/pyplot.py:docstring of matplotlib.pyplot.violinplot:58" - ], - "make_image": [ - "lib/matplotlib/image.py:docstring of matplotlib.image.composite_images:9" - ], "matplotlib.animation.ArtistAnimation.new_frame_seq": [ "doc/api/_as_gen/matplotlib.animation.ArtistAnimation.rst:23::1" ], @@ -613,21 +387,6 @@ ], "matplotlib.typing._HT": [ ":1" - ], - "mpl_toolkits.axislines.Axes": [ - "lib/mpl_toolkits/axisartist/axis_artist.py:docstring of mpl_toolkits.axisartist.axis_artist:7" - ], - "option_scale_image": [ - "lib/matplotlib/backends/backend_cairo.py:docstring of matplotlib.backends.backend_cairo.RendererCairo.draw_image:22", - "lib/matplotlib/backends/backend_pdf.py:docstring of matplotlib.backends.backend_pdf.RendererPdf.draw_image:22", - "lib/matplotlib/backends/backend_ps.py:docstring of matplotlib.backends.backend_ps.RendererPS.draw_image:22", - "lib/matplotlib/backends/backend_template.py:docstring of matplotlib.backends.backend_template.RendererTemplate.draw_image:22" - ], - "toggled": [ - "lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.AxisScaleBase.disable:4", - "lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.AxisScaleBase.enable:4", - "lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.AxisScaleBase.trigger:2", - "lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ZoomPanBase.trigger:2" ] } } diff --git a/galleries/users_explain/axes/axes_intro.rst b/galleries/users_explain/axes/axes_intro.rst index 948dd51c8b1e..16738d929056 100644 --- a/galleries/users_explain/axes/axes_intro.rst +++ b/galleries/users_explain/axes/axes_intro.rst @@ -130,7 +130,7 @@ Note that text can also be added to axes using `~.axes.Axes.text`, and `~.axes.A Axes limits, scales, and ticking -------------------------------- -Each Axes has two (or more) `~.axis.Axis` objects, that can be accessed via :attr:`~matplotlib.axes.Axes.xaxis` and :attr:`~matplotlib.axes.Axes.yaxis` properties. These have substantial number of methods on them, and for highly customizable Axis-es it is useful to read the API at `~.axis.Axis`. However, the Axes class offers a number of helpers for the most common of these methods. Indeed, the `~.axes.Axes.set_xlabel`, discussed above, is a helper for the `~.Axis.set_label_text`. +Each Axes has two (or more) `~.axis.Axis` objects, that can be accessed via :attr:`!matplotlib.axes.Axes.xaxis` and :attr:`!matplotlib.axes.Axes.yaxis` properties. These have substantial number of methods on them, and for highly customizable Axis-es it is useful to read the API at `~.axis.Axis`. However, the Axes class offers a number of helpers for the most common of these methods. Indeed, the `~.axes.Axes.set_xlabel`, discussed above, is a helper for the `~.Axis.set_label_text`. Other important methods set the extent on the axes (`~.axes.Axes.set_xlim`, `~.axes.Axes.set_ylim`), or more fundamentally the scale of the axes. So for instance, we can make an Axis have a logarithmic scale, and zoom in on a sub-portion of the data: diff --git a/galleries/users_explain/figure/interactive.rst b/galleries/users_explain/figure/interactive.rst index b06283152e50..c6fc3c2025d7 100644 --- a/galleries/users_explain/figure/interactive.rst +++ b/galleries/users_explain/figure/interactive.rst @@ -360,7 +360,7 @@ however, nbagg does not work in Jupyter Lab. To get the interactive functionality described here, you must be using an interactive backend. The default backend in notebooks, - the inline backend, is not. `~ipykernel.pylab.backend_inline` + the inline backend, is not. `!ipykernel.pylab.backend_inline` renders the figure once and inserts a static image into the notebook when the cell is executed. Because the images are static, they cannot be panned / zoomed, take user input, or be updated from other diff --git a/galleries/users_explain/figure/interactive_guide.rst b/galleries/users_explain/figure/interactive_guide.rst index b08231e84f7e..63138a729d09 100644 --- a/galleries/users_explain/figure/interactive_guide.rst +++ b/galleries/users_explain/figure/interactive_guide.rst @@ -320,7 +320,7 @@ with what is displayed on the screen. This is intended to be used to determine if ``draw_idle`` should be called to schedule a re-rendering of the figure. -Each artist has a `.Artist.stale_callback` attribute which holds a callback +Each artist has a `!Artist.stale_callback` attribute which holds a callback with the signature :: def callback(self: Artist, val: bool) -> None: @@ -339,7 +339,7 @@ default callback is `None`. If you call `.pyplot.ion` and are not in `~.backend_bases.FigureCanvasBase.draw_idle` on any stale figures after having executed the user's input, but before returning the prompt to the user. If you are not using `.pyplot` you can use the callback -`Figure.stale_callback` attribute to be notified when a figure has +`!Figure.stale_callback` attribute to be notified when a figure has become stale. @@ -420,7 +420,7 @@ IPython / prompt_toolkit With IPython >= 5.0 IPython has changed from using CPython's readline based prompt to a ``prompt_toolkit`` based prompt. ``prompt_toolkit`` has the same conceptual input hook, which is fed into ``prompt_toolkit`` via the -:meth:`IPython.terminal.interactiveshell.TerminalInteractiveShell.inputhook` +:meth:`!IPython.terminal.interactiveshell.TerminalInteractiveShell.inputhook` method. The source for the ``prompt_toolkit`` input hooks lives at ``IPython.terminal.pt_inputhooks``. diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index da4d693c6bd0..bc14dffff596 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -352,7 +352,7 @@ def inset_axes(self, bounds, *, transform=None, zorder=5, **kwargs): Lower-left corner of inset Axes, and its width and height. transform : `.Transform` - Defaults to `ax.transAxes`, i.e. the units of *rect* are in + Defaults to `!ax.transAxes`, i.e. the units of *rect* are in Axes-relative coordinates. projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \ @@ -8504,7 +8504,7 @@ def violinplot(self, dataset, positions=None, vert=None, bw_method : {'scott', 'silverman'} or float or callable, default: 'scott' The method used to calculate the estimator bandwidth. If a - float, this will be used directly as `kde.factor`. If a + float, this will be used directly as `!kde.factor`. If a callable, it should take a `matplotlib.mlab.GaussianKDE` instance as its only parameter and return a float. diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index bcf072caef80..2661bd91c941 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -4066,7 +4066,7 @@ def format_xdata(self, x): """ Return *x* formatted as an x-value. - This function will use the `.fmt_xdata` attribute if it is not None, + This function will use the `!fmt_xdata` attribute if it is not None, else will fall back on the xaxis major formatter. """ return (self.fmt_xdata if self.fmt_xdata is not None @@ -4076,7 +4076,7 @@ def format_ydata(self, y): """ Return *y* formatted as a y-value. - This function will use the `.fmt_ydata` attribute if it is not None, + This function will use the `!fmt_ydata` attribute if it is not None, else will fall back on the yaxis major formatter. """ return (self.fmt_ydata if self.fmt_ydata is not None diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 9b9cfe3ccc76..9e64636e662f 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -225,7 +225,7 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms, Backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods - `_iter_collection_raw_paths` and `_iter_collection` are provided to + `!_iter_collection_raw_paths` and `!_iter_collection` are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of `draw_path_collection` can be made globally. @@ -441,12 +441,13 @@ def draw_image(self, gc, x, y, im, transform=None): transform : `~matplotlib.transforms.Affine2DBase` If and only if the concrete backend is written such that - `option_scale_image` returns ``True``, an affine transformation - (i.e., an `.Affine2DBase`) *may* be passed to `draw_image`. The - translation vector of the transformation is given in physical units - (i.e., dots or pixels). Note that the transformation does not - override *x* and *y*, and has to be applied *before* translating - the result by *x* and *y* (this can be accomplished by adding *x* + `~.RendererBase.option_scale_image` returns ``True``, an affine + transformation (i.e., an `.Affine2DBase`) *may* be passed to + `~.RendererBase.draw_image`. The translation vector of the + transformation is given in physical units (i.e., dots or pixels). + Note that the transformation does not override *x* and *y*, + and has to be applied *before* translatingthe result by + *x* and *y* (this can be accomplished by adding *x* and *y* to the translation vector defined by *transform*). """ raise NotImplementedError @@ -463,8 +464,8 @@ def option_image_nocomposite(self): def option_scale_image(self): """ - Return whether arbitrary affine transformations in `draw_image` are - supported (True for most vector backends). + Return whether arbitrary affine transformations in + `~.RendererBase.draw_image` are supported (True for most vector backends). """ return False @@ -1020,7 +1021,7 @@ class TimerBase: Subclasses may additionally override the following methods: - ``_timer_set_single_shot``: Code for setting the timer to single shot - operating mode, if supported by the timer object. If not, the `Timer` + operating mode, if supported by the timer object. If not, the `TimerBase` class itself will store the flag and the ``_on_timer`` method should be overridden to support such behavior. @@ -2307,7 +2308,7 @@ def mpl_disconnect(self, cid): def new_timer(self, interval=None, callbacks=None): """ - Create a new backend-specific subclass of `.Timer`. + Create a new backend-specific subclass of `.TimerBase`. This is useful for getting periodic events through the backend's native event loop. Implemented only for backends with GUIs. @@ -3289,7 +3290,7 @@ class ToolContainerBase: Attributes ---------- toolmanager : `.ToolManager` - The tools with which this `ToolContainer` wants to communicate. + The tools with which this `ToolContainerBase` wants to communicate. """ _icon_extension = '.png' @@ -3458,7 +3459,7 @@ def remove_toolitem(self, name): called when `.ToolManager` emits a ``tool_removed_event``. Because some tools are present only on the `.ToolManager` but not on - the `ToolContainer`, this method must be a no-op when called on a tool + the `ToolContainerBase`, this method must be a no-op when called on a tool absent from the container. .. warning:: diff --git a/lib/matplotlib/backend_tools.py b/lib/matplotlib/backend_tools.py index 87ed794022a0..9410a73eff5f 100644 --- a/lib/matplotlib/backend_tools.py +++ b/lib/matplotlib/backend_tools.py @@ -192,7 +192,7 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def trigger(self, sender, event, data=None): - """Calls `enable` or `disable` based on `toggled` value.""" + """Calls `enable` or `disable` based on `~ToolToggleBase.toggled` value.""" if self._toggled: self.disable(event) else: @@ -203,7 +203,7 @@ def enable(self, event=None): """ Enable the toggle tool. - `trigger` calls this method when `toggled` is False. + `trigger` calls this method when `~ToolToggleBase.toggled` is False. """ pass @@ -211,7 +211,7 @@ def disable(self, event=None): """ Disable the toggle tool. - `trigger` call this method when `toggled` is True. + `trigger` call this method when `~ToolToggleBase.toggled` is True. This can happen in different circumstances. diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index 51ada59a21a0..5ed3f16fab95 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -737,7 +737,7 @@ def add_lines(self, *args, **kwargs): """ Draw lines on the colorbar. - The lines are appended to the list :attr:`lines`. + The lines are appended to the list :attr:`!lines`. Parameters ---------- diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py index bd21367ce73d..069c24caef86 100644 --- a/lib/matplotlib/dviread.py +++ b/lib/matplotlib/dviread.py @@ -651,7 +651,7 @@ class Vf(Dvi): The virtual font format is a derivative of dvi: http://mirrors.ctan.org/info/knuth/virtual-fonts This class reuses some of the machinery of `Dvi` - but replaces the `_read` loop and dispatch mechanism. + but replaces the `!_read` loop and dispatch mechanism. Examples -------- diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 53ea452f4c84..1a2a8a648863 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -65,8 +65,8 @@ def composite_images(images, renderer, magnification=1.0): Parameters ---------- images : list of Images - Each must have a `make_image` method. For each image, - `can_composite` should return `True`, though this is not + Each must have a `!make_image` method. For each image, + `!can_composite` should return `True`, though this is not enforced by this function. Each image must have a purely affine transformation with no shear. diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index ace3f668e740..26315c445a25 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -204,7 +204,7 @@ def _update_bbox_to_anchor(self, loc_in_canvas): bbox_transform : None or `~matplotlib.transforms.Transform` The transform for the bounding box (*bbox_to_anchor*). For a value of ``None`` (default) the Axes' - :data:`~matplotlib.axes.Axes.transAxes` transform will be used. + :data:`!matplotlib.axes.Axes.transAxes` transform will be used. title : str or None The legend's title. Default is no title (``None``). diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index 8326ac186e31..f538b79e44f0 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -778,7 +778,7 @@ class GaussianKDE: array, otherwise a 2D array with shape (# of dims, # of data). bw_method : {'scott', 'silverman'} or float or callable, optional The method used to calculate the estimator bandwidth. If a - float, this will be used directly as `kde.factor`. If a + float, this will be used directly as `!kde.factor`. If a callable, it should take a `GaussianKDE` instance as only parameter and return a float. If None (default), 'scott' is used. @@ -791,11 +791,11 @@ class GaussianKDE: num_dp : int Number of datapoints. factor : float - The bandwidth factor, obtained from `kde.covariance_factor`, with which + The bandwidth factor, obtained from `~GaussianKDE.covariance_factor`, with which the covariance matrix is multiplied. covariance : ndarray The covariance matrix of *dataset*, scaled by the calculated bandwidth - (`kde.factor`). + (`!kde.factor`). inv_cov : ndarray The inverse of *covariance*. diff --git a/lib/matplotlib/patheffects.py b/lib/matplotlib/patheffects.py index e7a0138bd750..e12713e2796e 100644 --- a/lib/matplotlib/patheffects.py +++ b/lib/matplotlib/patheffects.py @@ -235,7 +235,7 @@ def __init__(self, offset=(2, -2), is not specified. **kwargs Extra keywords are stored and passed through to - :meth:`AbstractPathEffect._update_gc`. + :meth:`!AbstractPathEffect._update_gc`. """ super().__init__(offset) @@ -304,7 +304,7 @@ def __init__(self, offset=(2, -2), is ``None``. **kwargs Extra keywords are stored and passed through to - :meth:`AbstractPathEffect._update_gc`. + :meth:`!AbstractPathEffect._update_gc`. """ super().__init__(offset) if shadow_color is None: @@ -409,7 +409,7 @@ def __init__(self, offset=(0, 0), when angle=90 and length=2.0 when angle=60. **kwargs Extra keywords are stored and passed through to - :meth:`AbstractPathEffect._update_gc`. + :meth:`!AbstractPathEffect._update_gc`. Examples -------- diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py index e66f1f97b21f..91c510ca7060 100644 --- a/lib/matplotlib/quiver.py +++ b/lib/matplotlib/quiver.py @@ -921,9 +921,9 @@ class Barbs(mcollections.PolyCollection): are changed using the :meth:`set_offsets` collection method. Possibly this method will be useful in animations. - There is one internal function :meth:`_find_tails` which finds + There is one internal function :meth:`!_find_tails` which finds exactly what should be put on the barb given the vector magnitude. - From there :meth:`_make_barbs` is used to find the vertices of the + From there :meth:`!_make_barbs` is used to find the vertices of the polygon to represent the barb based on this information. """ diff --git a/lib/matplotlib/scale.py b/lib/matplotlib/scale.py index ccaaae6caf5d..ff7b2590c10d 100644 --- a/lib/matplotlib/scale.py +++ b/lib/matplotlib/scale.py @@ -34,7 +34,7 @@ class ScaleBase: Subclasses should override - :attr:`name` + :attr:`!name` The scale's name. :meth:`get_transform` A method returning a `.Transform`, which converts data coordinates to diff --git a/lib/matplotlib/testing/compare.py b/lib/matplotlib/testing/compare.py index 0f252bc1da8e..fa21691ea0d4 100644 --- a/lib/matplotlib/testing/compare.py +++ b/lib/matplotlib/testing/compare.py @@ -397,7 +397,7 @@ def compare_images(expected, actual, tol, in_decorator=False): Compare two "image" files checking differences within a tolerance. The two given filenames may point to files which are convertible to - PNG via the `.converter` dictionary. The underlying RMS is calculated + PNG via the `!converter` dictionary. The underlying RMS is calculated with the `.calculate_rms` function. Parameters diff --git a/lib/matplotlib/transforms.py b/lib/matplotlib/transforms.py index 2934b0a77809..fb9dd96a7fdf 100644 --- a/lib/matplotlib/transforms.py +++ b/lib/matplotlib/transforms.py @@ -242,7 +242,7 @@ def x0(self): The first of the pair of *x* coordinates that define the bounding box. This is not guaranteed to be less than :attr:`x1` (for that, use - :attr:`xmin`). + :attr:`~BboxBase.xmin`). """ return self.get_points()[0, 0] @@ -252,7 +252,7 @@ def y0(self): The first of the pair of *y* coordinates that define the bounding box. This is not guaranteed to be less than :attr:`y1` (for that, use - :attr:`ymin`). + :attr:`~BboxBase.ymin`). """ return self.get_points()[0, 1] @@ -262,7 +262,7 @@ def x1(self): The second of the pair of *x* coordinates that define the bounding box. This is not guaranteed to be greater than :attr:`x0` (for that, use - :attr:`xmax`). + :attr:`~BboxBase.xmax`). """ return self.get_points()[1, 0] @@ -272,7 +272,7 @@ def y1(self): The second of the pair of *y* coordinates that define the bounding box. This is not guaranteed to be greater than :attr:`y0` (for that, use - :attr:`ymax`). + :attr:`~BboxBase.ymax`). """ return self.get_points()[1, 1] @@ -282,7 +282,7 @@ def p0(self): The first pair of (*x*, *y*) coordinates that define the bounding box. This is not guaranteed to be the bottom-left corner (for that, use - :attr:`min`). + :attr:`~BboxBase.min`). """ return self.get_points()[0] @@ -292,7 +292,7 @@ def p1(self): The second pair of (*x*, *y*) coordinates that define the bounding box. This is not guaranteed to be the top-right corner (for that, use - :attr:`max`). + :attr:`~BboxBase.max`). """ return self.get_points()[1] @@ -364,7 +364,10 @@ def size(self): @property def bounds(self): - """Return (:attr:`x0`, :attr:`y0`, :attr:`width`, :attr:`height`).""" + """ + Return (:attr:`x0`, :attr:`y0`, :attr:`~BboxBase.width`, + :attr:`~BboxBase.height`). + """ (x0, y0), (x1, y1) = self.get_points() return (x0, y0, x1 - x0, y1 - y0) @@ -1476,14 +1479,14 @@ def transform(self, values): Parameters ---------- values : array-like - The input values as an array of length :attr:`input_dims` or - shape (N, :attr:`input_dims`). + The input values as an array of length :attr:`~Transform.input_dims` or + shape (N, :attr:`~Transform.input_dims`). Returns ------- array - The output values as an array of length :attr:`output_dims` or - shape (N, :attr:`output_dims`), depending on the input. + The output values as an array of length :attr:`~Transform.output_dims` or + shape (N, :attr:`~Transform.output_dims`), depending on the input. """ # Ensure that values is a 2d array (but remember whether # we started with a 1d or 2d array). @@ -1521,14 +1524,14 @@ def transform_affine(self, values): Parameters ---------- values : array - The input values as an array of length :attr:`input_dims` or - shape (N, :attr:`input_dims`). + The input values as an array of length :attr:`~Transform.input_dims` or + shape (N, :attr:`~Transform.input_dims`). Returns ------- array - The output values as an array of length :attr:`output_dims` or - shape (N, :attr:`output_dims`), depending on the input. + The output values as an array of length :attr:`~Transform.output_dims` or + shape (N, :attr:`~Transform.output_dims`), depending on the input. """ return self.get_affine().transform(values) @@ -1546,14 +1549,17 @@ def transform_non_affine(self, values): Parameters ---------- values : array - The input values as an array of length :attr:`input_dims` or - shape (N, :attr:`input_dims`). + The input values as an array of length + :attr:`~matplotlib.transforms.Transform.input_dims` or + shape (N, :attr:`~matplotlib.transforms.Transform.input_dims`). Returns ------- array - The output values as an array of length :attr:`output_dims` or - shape (N, :attr:`output_dims`), depending on the input. + The output values as an array of length + :attr:`~matplotlib.transforms.Transform.output_dims` or shape + (N, :attr:`~matplotlib.transforms.Transform.output_dims`), + depending on the input. """ return values diff --git a/lib/matplotlib/tri/_trirefine.py b/lib/matplotlib/tri/_trirefine.py index 7f5110ab9e21..6a7037ad74fd 100644 --- a/lib/matplotlib/tri/_trirefine.py +++ b/lib/matplotlib/tri/_trirefine.py @@ -64,7 +64,7 @@ def __init__(self, triangulation): def refine_triangulation(self, return_tri_index=False, subdiv=3): """ Compute a uniformly refined triangulation *refi_triangulation* of - the encapsulated :attr:`triangulation`. + the encapsulated :attr:`!triangulation`. This function refines the encapsulated triangulation by splitting each father triangle into 4 child sub-triangles built on the edges midside diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 9c676574310c..6b196571814d 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -1159,7 +1159,7 @@ def set_active(self, index, state=None): """ Modify the state of a check button by index. - Callbacks will be triggered if :attr:`eventson` is True. + Callbacks will be triggered if :attr:`!eventson` is True. Parameters ---------- @@ -1734,7 +1734,7 @@ def set_active(self, index): """ Select button with number *index*. - Callbacks will be triggered if :attr:`eventson` is True. + Callbacks will be triggered if :attr:`!eventson` is True. Parameters ---------- diff --git a/lib/mpl_toolkits/axes_grid1/anchored_artists.py b/lib/mpl_toolkits/axes_grid1/anchored_artists.py index 214b15843ebf..a8be06800a07 100644 --- a/lib/mpl_toolkits/axes_grid1/anchored_artists.py +++ b/lib/mpl_toolkits/axes_grid1/anchored_artists.py @@ -83,7 +83,7 @@ def __init__(self, transform, loc, ---------- transform : `~matplotlib.transforms.Transform` The transformation object for the coordinate system in use, i.e., - :attr:`matplotlib.axes.Axes.transData`. + :attr:`!matplotlib.axes.Axes.transData`. loc : str Location of this artist. Valid locations are 'upper left', 'upper center', 'upper right', @@ -137,7 +137,7 @@ def __init__(self, transform, size, label, loc, ---------- transform : `~matplotlib.transforms.Transform` The transformation object for the coordinate system in use, i.e., - :attr:`matplotlib.axes.Axes.transData`. + :attr:`!matplotlib.axes.Axes.transData`. size : float Horizontal length of the size bar, given in coordinates of *transform*. @@ -256,7 +256,7 @@ def __init__(self, transform, label_x, label_y, length=0.15, ---------- transform : `~matplotlib.transforms.Transform` The transformation object for the coordinate system in use, i.e., - :attr:`matplotlib.axes.Axes.transAxes`. + :attr:`!matplotlib.axes.Axes.transAxes`. label_x, label_y : str Label text for the x and y arrows length : float, default: 0.15 diff --git a/lib/mpl_toolkits/axes_grid1/axes_grid.py b/lib/mpl_toolkits/axes_grid1/axes_grid.py index 20abf18ea79c..ec366b45f454 100644 --- a/lib/mpl_toolkits/axes_grid1/axes_grid.py +++ b/lib/mpl_toolkits/axes_grid1/axes_grid.py @@ -349,7 +349,7 @@ def __init__(self, fig, Whether to create a colorbar for "each" axes, a "single" colorbar for the entire grid, colorbars only for axes on the "edge" determined by *cbar_location*, or no colorbars. The colorbars are - stored in the :attr:`cbar_axes` attribute. + stored in the :attr:`!cbar_axes` attribute. cbar_location : {"left", "right", "bottom", "top"}, default: "right" cbar_pad : float, default: None Padding between the image axes and the colorbar axes. @@ -358,7 +358,7 @@ def __init__(self, fig, ``cbar_mode="single"`` no longer adds *axes_pad* between the axes and the colorbar if the *cbar_location* is "left" or "bottom". - cbar_size : size specification (see `.Size.from_any`), default: "5%" + cbar_size : size specification (see `!.Size.from_any`), default: "5%" Colorbar size. cbar_set_cax : bool, default: True If True, each axes in the grid has a *cax* attribute that is bound diff --git a/lib/mpl_toolkits/axes_grid1/axes_size.py b/lib/mpl_toolkits/axes_grid1/axes_size.py index 86e5f70d9824..55820827cd6a 100644 --- a/lib/mpl_toolkits/axes_grid1/axes_size.py +++ b/lib/mpl_toolkits/axes_grid1/axes_size.py @@ -1,7 +1,7 @@ """ Provides classes of simple units that will be used with `.AxesDivider` class (or others) to determine the size of each Axes. The unit -classes define `get_size` method that returns a tuple of two floats, +classes define `!get_size` method that returns a tuple of two floats, meaning relative and absolute sizes, respectively. Note that this class is nothing more than a simple tuple of two diff --git a/lib/mpl_toolkits/axisartist/axis_artist.py b/lib/mpl_toolkits/axisartist/axis_artist.py index b416d56abe6b..ae8d5338affa 100644 --- a/lib/mpl_toolkits/axisartist/axis_artist.py +++ b/lib/mpl_toolkits/axisartist/axis_artist.py @@ -7,7 +7,7 @@ There is one `AxisArtist` per Axis; it can be accessed through the ``axis`` dictionary of the parent Axes (which should be a -`mpl_toolkits.axislines.Axes`), e.g. ``ax.axis["bottom"]``. +`~mpl_toolkits.axisartist.axislines.Axes`), e.g. ``ax.axis["bottom"]``. Children of the AxisArtist are accessed as attributes: ``.line`` and ``.label`` for the axis line and label, ``.major_ticks``, ``.major_ticklabels``, diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index f58d2eedf80e..3e2ebf47e67d 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -1400,7 +1400,7 @@ def _set_view(self, view): def format_zdata(self, z): """ Return *z* string formatted. This function will use the - :attr:`fmt_zdata` attribute if it is callable, else will fall + :attr:`!fmt_zdata` attribute if it is callable, else will fall back on the zaxis major formatter """ try: