From ac7f86b4eef2776f10f34dafdc13b9840fa2cda9 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:24:58 +0200 Subject: [PATCH] Close all plot windows of a blocking show() on Ctrl+C Addresses the Qt part of #23385. It appears that `qapp.quit()` does not automatically close the windows of the app. We therefore do it explicitly. A unit test for this would be quite complex. Test this by hand by Ctrl+C in an interactive shell. --- doc/_templates/autosummary_class_only_noindex.rst | 13 +++++++++++++ doc/api/figure_api.rst | 7 ++++++- galleries/examples/animation/multiple_axes.py | 2 +- galleries/examples/axes_grid1/demo_axes_divider.py | 4 ++-- galleries/examples/axes_grid1/demo_axes_grid.py | 2 +- .../examples/axes_grid1/demo_axes_hbox_divider.py | 2 +- .../axes_grid1/demo_colorbar_of_inset_axes.py | 2 +- .../axes_grid1/demo_colorbar_with_axes_divider.py | 12 ++++++------ .../axes_grid1/demo_colorbar_with_inset_locator.py | 2 +- .../axes_grid1/scatter_hist_locatable_axes.py | 6 +++--- .../examples/axisartist/demo_curvelinear_grid2.py | 2 +- galleries/examples/axisartist/demo_parasite_axes.py | 2 +- galleries/examples/color/colorbar_basics.py | 2 +- galleries/examples/event_handling/data_browser.py | 2 +- .../image_annotated_heatmap.py | 2 +- .../lines_bars_and_markers/eventcollection_demo.py | 2 +- .../examples/lines_bars_and_markers/filled_step.py | 4 ++-- .../examples/lines_bars_and_markers/gradient_bar.py | 2 +- .../examples/lines_bars_and_markers/scatter_hist.py | 10 +++++----- galleries/examples/misc/coords_report.py | 2 +- galleries/examples/misc/fig_x.py | 2 +- galleries/examples/misc/logos2.py | 2 +- galleries/examples/misc/rasterization_demo.py | 2 +- galleries/examples/mplot3d/mixed_subplots.py | 2 +- galleries/examples/mplot3d/pathpatch3d.py | 2 +- .../examples/pie_and_polar_charts/bar_of_pie.py | 2 +- galleries/examples/pyplots/pyplot_text.py | 2 +- .../shapes_and_collections/patch_collection.py | 2 +- .../specialty_plots/leftventricle_bullseye.py | 2 +- galleries/examples/specialty_plots/radar_chart.py | 2 +- .../examples/spines/multiple_yaxis_with_spines.py | 4 ++-- galleries/examples/spines/spines_dropped.py | 2 +- galleries/examples/statistics/boxplot.py | 2 +- galleries/examples/statistics/confidence_ellipse.py | 2 +- .../subplots_axes_and_figures/axes_box_aspect.py | 2 +- .../examples/subplots_axes_and_figures/axes_demo.py | 2 +- .../subplots_axes_and_figures/axes_zoom_effect.py | 12 ++++++------ .../subplots_axes_and_figures/axhspan_demo.py | 4 ++-- .../demo_constrained_layout.py | 6 +++--- .../subplots_axes_and_figures/demo_tight_layout.py | 4 ++-- .../fahrenheit_celsius_scales.py | 2 +- .../subplots_axes_and_figures/figure_title.py | 2 +- .../gridspec_and_subplots.py | 8 ++++---- .../subplots_axes_and_figures/multiple_figs_demo.py | 2 +- .../share_axis_lims_views.py | 2 +- .../subplots_axes_and_figures/shared_axis_demo.py | 2 +- .../subplots_axes_and_figures/two_scales.py | 10 +++++----- .../subplots_axes_and_figures/zoom_inset_axes.py | 4 ++-- .../text_labels_and_annotations/arrow_demo.py | 2 +- .../demo_text_rotation_mode.py | 2 +- .../text_labels_and_annotations/label_subplots.py | 2 +- .../placing_text_boxes.py | 2 +- .../text_labels_and_annotations/titles_demo.py | 2 +- .../examples/ticks/colorbar_tick_labelling_demo.py | 2 +- galleries/examples/widgets/multicursor.py | 4 ++-- galleries/users_explain/artists/color_cycle.py | 4 ++-- galleries/users_explain/artists/imshow_extent.py | 2 +- .../users_explain/artists/transforms_tutorial.py | 6 +++--- galleries/users_explain/axes/arranging_axes.py | 2 +- galleries/users_explain/axes/autoscale.py | 2 +- galleries/users_explain/axes/colorbar_placement.py | 4 ++-- lib/matplotlib/backends/qt_compat.py | 2 ++ lib/matplotlib/figure.py | 12 ++++++------ 63 files changed, 122 insertions(+), 102 deletions(-) create mode 100644 doc/_templates/autosummary_class_only_noindex.rst diff --git a/doc/_templates/autosummary_class_only_noindex.rst b/doc/_templates/autosummary_class_only_noindex.rst new file mode 100644 index 000000000000..3083dbb24f28 --- /dev/null +++ b/doc/_templates/autosummary_class_only_noindex.rst @@ -0,0 +1,13 @@ +{{ fullname | escape | underline }} + + +.. currentmodule:: {{ module }} + + +{% if objtype in ['class'] %} + +.. auto{{ objtype }}:: {{ objname }} + :no-members: + :no-index: + +{% endif %} diff --git a/doc/api/figure_api.rst b/doc/api/figure_api.rst index 84d068f5c3af..655f68d21e59 100644 --- a/doc/api/figure_api.rst +++ b/doc/api/figure_api.rst @@ -10,9 +10,14 @@ The Figure class ================ +.. class:: Figure + +Creation +-------- + .. autosummary:: :toctree: _as_gen - :template: autosummary_class_only.rst + :template: autosummary_class_only_noindex.rst :nosignatures: Figure diff --git a/galleries/examples/animation/multiple_axes.py b/galleries/examples/animation/multiple_axes.py index 2c3442c36d63..9f1c31429520 100644 --- a/galleries/examples/animation/multiple_axes.py +++ b/galleries/examples/animation/multiple_axes.py @@ -1,6 +1,6 @@ """ ======================= -Multiple axes animation +Multiple Axes animation ======================= This example showcases: diff --git a/galleries/examples/axes_grid1/demo_axes_divider.py b/galleries/examples/axes_grid1/demo_axes_divider.py index ed2e163154c4..b965da239098 100644 --- a/galleries/examples/axes_grid1/demo_axes_divider.py +++ b/galleries/examples/axes_grid1/demo_axes_divider.py @@ -3,8 +3,8 @@ Axes divider ============ -Axes divider to calculate location of axes and -create a divider for them using existing axes instances. +Axes divider to calculate location of Axes and +create a divider for them using existing Axes instances. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/axes_grid1/demo_axes_grid.py b/galleries/examples/axes_grid1/demo_axes_grid.py index 70bb19da38fa..d9cfec162fc7 100644 --- a/galleries/examples/axes_grid1/demo_axes_grid.py +++ b/galleries/examples/axes_grid1/demo_axes_grid.py @@ -3,7 +3,7 @@ Demo Axes Grid ============== -Grid of 2x2 images with a single colorbar or with one colorbar per axes. +Grid of 2x2 images with a single colorbar or with one colorbar per Axes. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/axes_grid1/demo_axes_hbox_divider.py b/galleries/examples/axes_grid1/demo_axes_hbox_divider.py index 65d6764a3374..e42e421972dc 100644 --- a/galleries/examples/axes_grid1/demo_axes_hbox_divider.py +++ b/galleries/examples/axes_grid1/demo_axes_hbox_divider.py @@ -5,7 +5,7 @@ Using an `.HBoxDivider` to arrange subplots. -Note that both axes' location are adjusted so that they have +Note that both Axes' location are adjusted so that they have equal heights while maintaining their aspect ratios. """ diff --git a/galleries/examples/axes_grid1/demo_colorbar_of_inset_axes.py b/galleries/examples/axes_grid1/demo_colorbar_of_inset_axes.py index 341e11ff52b5..242beec26266 100644 --- a/galleries/examples/axes_grid1/demo_colorbar_of_inset_axes.py +++ b/galleries/examples/axes_grid1/demo_colorbar_of_inset_axes.py @@ -1,6 +1,6 @@ """ =============================== -Adding a colorbar to inset axes +Adding a colorbar to inset Axes =============================== """ diff --git a/galleries/examples/axes_grid1/demo_colorbar_with_axes_divider.py b/galleries/examples/axes_grid1/demo_colorbar_with_axes_divider.py index 9e4611c65bb7..1a1eb1d8c48d 100644 --- a/galleries/examples/axes_grid1/demo_colorbar_with_axes_divider.py +++ b/galleries/examples/axes_grid1/demo_colorbar_with_axes_divider.py @@ -5,14 +5,14 @@ Colorbar with AxesDivider ========================= -The `.axes_divider.make_axes_locatable` function takes an existing axes, adds +The `.axes_divider.make_axes_locatable` function takes an existing Axes, adds it to a new `.AxesDivider` and returns the `.AxesDivider`. The `.append_axes` -method of the `.AxesDivider` can then be used to create a new axes on a given -side ("top", "right", "bottom", or "left") of the original axes. This example -uses `.append_axes` to add colorbars next to axes. +method of the `.AxesDivider` can then be used to create a new Axes on a given +side ("top", "right", "bottom", or "left") of the original Axes. This example +uses `.append_axes` to add colorbars next to Axes. -Users should consider simply passing the main axes to the *ax* keyword argument of -`~.Figure.colorbar` instead of creating a locatable axes manually like this. +Users should consider simply passing the main Axes to the *ax* keyword argument of +`~.Figure.colorbar` instead of creating a locatable Axes manually like this. See :ref:`colorbar_placement`. """ diff --git a/galleries/examples/axes_grid1/demo_colorbar_with_inset_locator.py b/galleries/examples/axes_grid1/demo_colorbar_with_inset_locator.py index 8ec7d0e7271b..879ec0485967 100644 --- a/galleries/examples/axes_grid1/demo_colorbar_with_inset_locator.py +++ b/galleries/examples/axes_grid1/demo_colorbar_with_inset_locator.py @@ -8,7 +8,7 @@ This example shows how to control the position, height, and width of colorbars using `~mpl_toolkits.axes_grid1.inset_locator.inset_axes`. -Inset axes placement is controlled as for legends: either by providing a *loc* +Inset Axes placement is controlled as for legends: either by providing a *loc* option ("upper right", "best", ...), or by providing a locator with respect to the parent bbox. Parameters such as *bbox_to_anchor* and *borderpad* likewise work in the same way, and are also demonstrated here. diff --git a/galleries/examples/axes_grid1/scatter_hist_locatable_axes.py b/galleries/examples/axes_grid1/scatter_hist_locatable_axes.py index 8304334b90eb..bfedaaf720c9 100644 --- a/galleries/examples/axes_grid1/scatter_hist_locatable_axes.py +++ b/galleries/examples/axes_grid1/scatter_hist_locatable_axes.py @@ -6,12 +6,12 @@ Show the marginal distributions of a scatter plot as histograms at the sides of the plot. -For a nice alignment of the main axes with the marginals, the axes positions +For a nice alignment of the main Axes with the marginals, the Axes positions are defined by a ``Divider``, produced via `.make_axes_locatable`. Note that -the ``Divider`` API allows setting axes sizes and pads in inches, which is its +the ``Divider`` API allows setting Axes sizes and pads in inches, which is its main feature. -If one wants to set axes sizes and pads relative to the main Figure, see the +If one wants to set Axes sizes and pads relative to the main Figure, see the :doc:`/gallery/lines_bars_and_markers/scatter_hist` example. """ diff --git a/galleries/examples/axisartist/demo_curvelinear_grid2.py b/galleries/examples/axisartist/demo_curvelinear_grid2.py index 4a8c115f196f..9bf3c5598244 100644 --- a/galleries/examples/axisartist/demo_curvelinear_grid2.py +++ b/galleries/examples/axisartist/demo_curvelinear_grid2.py @@ -7,7 +7,7 @@ This example demonstrates how to use GridHelperCurveLinear to define custom grids and ticklines by applying a transformation on the grid. -As showcase on the plot, a 5x5 matrix is displayed on the axes. +As showcase on the plot, a 5x5 matrix is displayed on the Axes. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/axisartist/demo_parasite_axes.py b/galleries/examples/axisartist/demo_parasite_axes.py index fb04e1e77873..8565ef455c7e 100644 --- a/galleries/examples/axisartist/demo_parasite_axes.py +++ b/galleries/examples/axisartist/demo_parasite_axes.py @@ -3,7 +3,7 @@ Parasite Axes demo ================== -Create a parasite axes. Such axes would share the x scale with a host axes, +Create a parasite Axes. Such Axes would share the x scale with a host Axes, but show a different scale in y direction. This approach uses `mpl_toolkits.axes_grid1.parasite_axes.HostAxes` and diff --git a/galleries/examples/color/colorbar_basics.py b/galleries/examples/color/colorbar_basics.py index 30fb7ed3096b..48366711d20f 100644 --- a/galleries/examples/color/colorbar_basics.py +++ b/galleries/examples/color/colorbar_basics.py @@ -5,7 +5,7 @@ Use `~.Figure.colorbar` by specifying the mappable object (here the `.AxesImage` returned by `~.axes.Axes.imshow`) -and the axes to attach the colorbar to. +and the Axes to attach the colorbar to. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/event_handling/data_browser.py b/galleries/examples/event_handling/data_browser.py index c24c77ecc57f..6d9068940285 100644 --- a/galleries/examples/event_handling/data_browser.py +++ b/galleries/examples/event_handling/data_browser.py @@ -23,7 +23,7 @@ class PointBrowser: """ Click on a point to select and highlight it -- the data that - generated the point will be shown in the lower axes. Use the 'n' + generated the point will be shown in the lower Axes. Use the 'n' and 'p' keys to browse through the next and previous points """ diff --git a/galleries/examples/images_contours_and_fields/image_annotated_heatmap.py b/galleries/examples/images_contours_and_fields/image_annotated_heatmap.py index 1802af0e6823..23d9fd48dff8 100644 --- a/galleries/examples/images_contours_and_fields/image_annotated_heatmap.py +++ b/galleries/examples/images_contours_and_fields/image_annotated_heatmap.py @@ -114,7 +114,7 @@ def heatmap(data, row_labels, col_labels, ax=None, A list or array of length N with the labels for the columns. ax A `matplotlib.axes.Axes` instance to which the heatmap is plotted. If - not provided, use current axes or create a new one. Optional. + not provided, use current Axes or create a new one. Optional. cbar_kw A dictionary with arguments to `matplotlib.Figure.colorbar`. Optional. cbarlabel diff --git a/galleries/examples/lines_bars_and_markers/eventcollection_demo.py b/galleries/examples/lines_bars_and_markers/eventcollection_demo.py index f82fb829c248..18783e1649bc 100644 --- a/galleries/examples/lines_bars_and_markers/eventcollection_demo.py +++ b/galleries/examples/lines_bars_and_markers/eventcollection_demo.py @@ -4,7 +4,7 @@ ==================== Plot two curves, then use `.EventCollection`\s to mark the locations of the x -and y data points on the respective axes for each curve. +and y data points on the respective Axes for each curve. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/lines_bars_and_markers/filled_step.py b/galleries/examples/lines_bars_and_markers/filled_step.py index abc806fc5acf..65a7d31a425a 100644 --- a/galleries/examples/lines_bars_and_markers/filled_step.py +++ b/galleries/examples/lines_bars_and_markers/filled_step.py @@ -25,7 +25,7 @@ def filled_hist(ax, edges, values, bottoms=None, orientation='v', Parameters ---------- ax : Axes - The axes to plot to + The Axes to plot to. edges : array A length n+1 array giving the left edges of each bin and the @@ -85,7 +85,7 @@ def stack_hist(ax, stacked_data, sty_cycle, bottoms=None, Parameters ---------- ax : axes.Axes - The axes to add artists too + The Axes to add artists to. stacked_data : array or Mapping A (M, N) shaped array. The first dimension will be iterated over to diff --git a/galleries/examples/lines_bars_and_markers/gradient_bar.py b/galleries/examples/lines_bars_and_markers/gradient_bar.py index 1c61a4bb908e..4cd86f26590f 100644 --- a/galleries/examples/lines_bars_and_markers/gradient_bar.py +++ b/galleries/examples/lines_bars_and_markers/gradient_bar.py @@ -30,7 +30,7 @@ def gradient_image(ax, direction=0.3, cmap_range=(0, 1), **kwargs): Parameters ---------- ax : Axes - The axes to draw on. + The Axes to draw on. direction : float The direction of the gradient. This is a number in range 0 (=vertical) to 1 (=horizontal). diff --git a/galleries/examples/lines_bars_and_markers/scatter_hist.py b/galleries/examples/lines_bars_and_markers/scatter_hist.py index 9e4598a15957..114752c746fb 100644 --- a/galleries/examples/lines_bars_and_markers/scatter_hist.py +++ b/galleries/examples/lines_bars_and_markers/scatter_hist.py @@ -6,23 +6,23 @@ Show the marginal distributions of a scatter plot as histograms at the sides of the plot. -For a nice alignment of the main axes with the marginals, two options are shown +For a nice alignment of the main Axes with the marginals, two options are shown below: .. contents:: :local: While `.Axes.inset_axes` may be a bit more complex, it allows correct handling -of main axes with a fixed aspect ratio. +of main Axes with a fixed aspect ratio. An alternative method to produce a similar figure using the ``axes_grid1`` toolkit is shown in the :doc:`/gallery/axes_grid1/scatter_hist_locatable_axes` -example. Finally, it is also possible to position all axes in absolute +example. Finally, it is also possible to position all Axes in absolute coordinates using `.Figure.add_axes` (not shown here). Let us first define a function that takes x and y data as input, as well -as three axes, the main axes for the scatter, and two marginal axes. It will -then create the scatter and histograms inside the provided axes. +as three Axes, the main Axes for the scatter, and two marginal Axes. It will +then create the scatter and histograms inside the provided Axes. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/misc/coords_report.py b/galleries/examples/misc/coords_report.py index 127ce712fc1e..84503be35c5f 100644 --- a/galleries/examples/misc/coords_report.py +++ b/galleries/examples/misc/coords_report.py @@ -3,7 +3,7 @@ Coords Report ============= -Override the default reporting of coords as the mouse moves over the axes +Override the default reporting of coords as the mouse moves over the Axes in an interactive backend. """ diff --git a/galleries/examples/misc/fig_x.py b/galleries/examples/misc/fig_x.py index 2985c2f1cffc..e2af3e766028 100644 --- a/galleries/examples/misc/fig_x.py +++ b/galleries/examples/misc/fig_x.py @@ -3,7 +3,7 @@ Adding lines to figures ======================= -Adding lines to a figure without any axes. +Adding lines to a figure without any Axes. .. redirect-from:: /gallery/pyplots/fig_x """ diff --git a/galleries/examples/misc/logos2.py b/galleries/examples/misc/logos2.py index 3a070535f83f..aca348474e7b 100644 --- a/galleries/examples/misc/logos2.py +++ b/galleries/examples/misc/logos2.py @@ -36,7 +36,7 @@ def get_font_properties(): def create_icon_axes(fig, ax_position, lw_bars, lw_grid, lw_border, rgrid): """ - Create a polar axes containing the matplotlib radar plot. + Create a polar Axes containing the matplotlib radar plot. Parameters ---------- diff --git a/galleries/examples/misc/rasterization_demo.py b/galleries/examples/misc/rasterization_demo.py index 7755e66745cb..ce0cf02dfac2 100644 --- a/galleries/examples/misc/rasterization_demo.py +++ b/galleries/examples/misc/rasterization_demo.py @@ -9,7 +9,7 @@ Whether rasterization should be used can be specified per artist. This can be useful to reduce the file size of large artists, while maintaining the -advantages of vector graphics for other artists such as the axes +advantages of vector graphics for other artists such as the Axes and text. For instance a complicated `~.Axes.pcolormesh` or `~.Axes.contourf` can be made significantly simpler by rasterizing. Setting rasterization only affects vector backends such as PDF, SVG, or PS. diff --git a/galleries/examples/mplot3d/mixed_subplots.py b/galleries/examples/mplot3d/mixed_subplots.py index 963044020f47..dc196f05f90d 100644 --- a/galleries/examples/mplot3d/mixed_subplots.py +++ b/galleries/examples/mplot3d/mixed_subplots.py @@ -1,6 +1,6 @@ """ ============================= -2D and 3D axes in same figure +2D and 3D Axes in same figure ============================= This example shows a how to plot a 2D and a 3D plot on the same figure. diff --git a/galleries/examples/mplot3d/pathpatch3d.py b/galleries/examples/mplot3d/pathpatch3d.py index f195e19e17a9..335b68003d31 100644 --- a/galleries/examples/mplot3d/pathpatch3d.py +++ b/galleries/examples/mplot3d/pathpatch3d.py @@ -17,7 +17,7 @@ def text3d(ax, xyz, s, zdir="z", size=None, angle=0, usetex=False, **kwargs): """ - Plots the string *s* on the axes *ax*, with position *xyz*, size *size*, + Plots the string *s* on the Axes *ax*, with position *xyz*, size *size*, and rotation angle *angle*. *zdir* gives the axis which is to be treated as the third dimension. *usetex* is a boolean indicating whether the string should be run through a LaTeX subprocess or not. Any additional keyword diff --git a/galleries/examples/pie_and_polar_charts/bar_of_pie.py b/galleries/examples/pie_and_polar_charts/bar_of_pie.py index f386f11bc9aa..1437cd5f2be2 100644 --- a/galleries/examples/pie_and_polar_charts/bar_of_pie.py +++ b/galleries/examples/pie_and_polar_charts/bar_of_pie.py @@ -6,7 +6,7 @@ Make a "bar of pie" chart where the first slice of the pie is "exploded" into a bar chart with a further breakdown of said slice's characteristics. The example demonstrates using a figure with multiple -sets of axes and using the axes patches list to add two ConnectionPatches +sets of Axes and using the axes patches list to add two ConnectionPatches to link the subplot charts. """ diff --git a/galleries/examples/pyplots/pyplot_text.py b/galleries/examples/pyplots/pyplot_text.py index 9fb9f4f1608c..72f977c2f985 100644 --- a/galleries/examples/pyplots/pyplot_text.py +++ b/galleries/examples/pyplots/pyplot_text.py @@ -5,7 +5,7 @@ Set the special text objects `~.pyplot.title`, `~.pyplot.xlabel`, and `~.pyplot.ylabel` through the dedicated pyplot functions. Additional text -objects can be placed in the axes using `~.pyplot.text`. +objects can be placed in the Axes using `~.pyplot.text`. You can use TeX-like mathematical typesetting in all texts; see also :ref:`mathtext`. diff --git a/galleries/examples/shapes_and_collections/patch_collection.py b/galleries/examples/shapes_and_collections/patch_collection.py index 8ac9c3a7c304..ca0dd8e1045d 100644 --- a/galleries/examples/shapes_and_collections/patch_collection.py +++ b/galleries/examples/shapes_and_collections/patch_collection.py @@ -6,7 +6,7 @@ This example demonstrates how to use `.collections.PatchCollection`. See also :doc:`/gallery/shapes_and_collections/artist_reference`, which instead -adds each artist separately to its own axes. +adds each artist separately to its own Axes. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/specialty_plots/leftventricle_bullseye.py b/galleries/examples/specialty_plots/leftventricle_bullseye.py index 70327f49c054..933e8f5a17ee 100644 --- a/galleries/examples/specialty_plots/leftventricle_bullseye.py +++ b/galleries/examples/specialty_plots/leftventricle_bullseye.py @@ -23,7 +23,7 @@ def bullseye_plot(ax, data, seg_bold=None, cmap="viridis", norm=None): Parameters ---------- - ax : axes + ax : Axes data : list[float] The intensity values for each of the 17 segments. seg_bold : list[int], optional diff --git a/galleries/examples/specialty_plots/radar_chart.py b/galleries/examples/specialty_plots/radar_chart.py index 3d17659d0bdf..200b0cb91147 100644 --- a/galleries/examples/specialty_plots/radar_chart.py +++ b/galleries/examples/specialty_plots/radar_chart.py @@ -36,7 +36,7 @@ def radar_factory(num_vars, frame='circle'): num_vars : int Number of variables for radar chart. frame : {'circle', 'polygon'} - Shape of frame surrounding axes. + Shape of frame surrounding Axes. """ # calculate evenly-spaced axis angles diff --git a/galleries/examples/spines/multiple_yaxis_with_spines.py b/galleries/examples/spines/multiple_yaxis_with_spines.py index c1dc95a62612..a0281bdeda0f 100644 --- a/galleries/examples/spines/multiple_yaxis_with_spines.py +++ b/galleries/examples/spines/multiple_yaxis_with_spines.py @@ -4,11 +4,11 @@ =========================== Create multiple y axes with a shared x-axis. This is done by creating -a `~.axes.Axes.twinx` axes, turning all spines but the right one invisible +a `~.axes.Axes.twinx` Axes, turning all spines but the right one invisible and offset its position using `~.spines.Spine.set_position`. Note that this approach uses `matplotlib.axes.Axes` and their -`~matplotlib.spines.Spine`\s. Alternative approaches using non-standard axes +`~matplotlib.spines.Spine`\s. Alternative approaches using non-standard Axes are shown in the :doc:`/gallery/axisartist/demo_parasite_axes` and :doc:`/gallery/axisartist/demo_parasite_axes2` examples. """ diff --git a/galleries/examples/spines/spines_dropped.py b/galleries/examples/spines/spines_dropped.py index 3adeee92ba37..015d6094d758 100644 --- a/galleries/examples/spines/spines_dropped.py +++ b/galleries/examples/spines/spines_dropped.py @@ -3,7 +3,7 @@ Dropped spines ============== -Demo of spines offset from the axes (a.k.a. "dropped spines"). +Demo of spines offset from the Axes (a.k.a. "dropped spines"). """ import matplotlib.pyplot as plt import numpy as np diff --git a/galleries/examples/statistics/boxplot.py b/galleries/examples/statistics/boxplot.py index 419352380c76..79b05386c5d9 100644 --- a/galleries/examples/statistics/boxplot.py +++ b/galleries/examples/statistics/boxplot.py @@ -8,7 +8,7 @@ individual components (note that the mean is the only value not shown by default). The second figure demonstrates how the styles of the artists can be customized. It also demonstrates how to set the limit of the whiskers to -specific percentiles (lower right axes) +specific percentiles (lower right Axes) A good general reference on boxplots and their history can be found here: https://vita.had.co.nz/papers/boxplots.pdf diff --git a/galleries/examples/statistics/confidence_ellipse.py b/galleries/examples/statistics/confidence_ellipse.py index 2a0427127773..08ae786f37f0 100644 --- a/galleries/examples/statistics/confidence_ellipse.py +++ b/galleries/examples/statistics/confidence_ellipse.py @@ -49,7 +49,7 @@ def confidence_ellipse(x, y, ax, n_std=3.0, facecolor='none', **kwargs): Input data. ax : matplotlib.axes.Axes - The axes object to draw the ellipse into. + The Axes object to draw the ellipse into. n_std : float The number of standard deviations to determine the ellipse's radiuses. diff --git a/galleries/examples/subplots_axes_and_figures/axes_box_aspect.py b/galleries/examples/subplots_axes_and_figures/axes_box_aspect.py index 9ad5a14b7649..dc686de34196 100644 --- a/galleries/examples/subplots_axes_and_figures/axes_box_aspect.py +++ b/galleries/examples/subplots_axes_and_figures/axes_box_aspect.py @@ -4,7 +4,7 @@ =============== This demo shows how to set the aspect of an Axes box directly via -`~.Axes.set_box_aspect`. The box aspect is the ratio between axes height +`~.Axes.set_box_aspect`. The box aspect is the ratio between Axes height and axes width in physical units, independent of the data limits. This is useful to e.g. produce a square plot, independent of the data it contains, or to have a usual plot with the same axes dimensions next to diff --git a/galleries/examples/subplots_axes_and_figures/axes_demo.py b/galleries/examples/subplots_axes_and_figures/axes_demo.py index 46a353d7475b..f3e86866b5a5 100644 --- a/galleries/examples/subplots_axes_and_figures/axes_demo.py +++ b/galleries/examples/subplots_axes_and_figures/axes_demo.py @@ -3,7 +3,7 @@ Axes Demo ========= -Example use of ``fig.add_axes`` to create inset axes within the main plot axes. +Example use of ``fig.add_axes`` to create inset Axes within the main plot Axes. Please see also the :ref:`axes_grid_examples` section, and the following three examples: diff --git a/galleries/examples/subplots_axes_and_figures/axes_zoom_effect.py b/galleries/examples/subplots_axes_and_figures/axes_zoom_effect.py index a8076db48528..49a44b9e4f43 100644 --- a/galleries/examples/subplots_axes_and_figures/axes_zoom_effect.py +++ b/galleries/examples/subplots_axes_and_figures/axes_zoom_effect.py @@ -42,17 +42,17 @@ def connect_bbox(bbox1, bbox2, def zoom_effect01(ax1, ax2, xmin, xmax, **kwargs): """ - Connect *ax1* and *ax2*. The *xmin*-to-*xmax* range in both axes will + Connect *ax1* and *ax2*. The *xmin*-to-*xmax* range in both Axes will be marked. Parameters ---------- ax1 - The main axes. + The main Axes. ax2 - The zoomed axes. + The zoomed Axes. xmin, xmax - The limits of the colored area in both plot axes. + The limits of the colored area in both plot Axes. **kwargs Arguments passed to the patch constructor. """ @@ -80,8 +80,8 @@ def zoom_effect01(ax1, ax2, xmin, xmax, **kwargs): def zoom_effect02(ax1, ax2, **kwargs): """ - ax1 : the main axes - ax1 : the zoomed axes + ax1 : the main Axes + ax1 : the zoomed Axes Similar to zoom_effect01. The xmin & xmax will be taken from the ax1.viewLim. diff --git a/galleries/examples/subplots_axes_and_figures/axhspan_demo.py b/galleries/examples/subplots_axes_and_figures/axhspan_demo.py index bc1d7bff154b..6aca2710f576 100644 --- a/galleries/examples/subplots_axes_and_figures/axhspan_demo.py +++ b/galleries/examples/subplots_axes_and_figures/axhspan_demo.py @@ -3,8 +3,8 @@ axhspan Demo ============ -Create lines or rectangles that span the axes in either the horizontal or -vertical direction, and lines than span the axes with an arbitrary orientation. +Create lines or rectangles that span the Axes in either the horizontal or +vertical direction, and lines than span the Axes with an arbitrary orientation. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/subplots_axes_and_figures/demo_constrained_layout.py b/galleries/examples/subplots_axes_and_figures/demo_constrained_layout.py index f16f419ece7a..a8836891cd11 100644 --- a/galleries/examples/subplots_axes_and_figures/demo_constrained_layout.py +++ b/galleries/examples/subplots_axes_and_figures/demo_constrained_layout.py @@ -1,11 +1,11 @@ """ ===================================== -Resizing axes with constrained layout +Resizing Axes with constrained layout ===================================== *Constrained layout* attempts to resize subplots in -a figure so that there are no overlaps between axes objects and labels -on the axes. +a figure so that there are no overlaps between Axes objects and labels +on the Axes. See :ref:`constrainedlayout_guide` for more details and :ref:`tight_layout_guide` for an alternative. diff --git a/galleries/examples/subplots_axes_and_figures/demo_tight_layout.py b/galleries/examples/subplots_axes_and_figures/demo_tight_layout.py index 0cc5f5301db4..7ac3a7376d67 100644 --- a/galleries/examples/subplots_axes_and_figures/demo_tight_layout.py +++ b/galleries/examples/subplots_axes_and_figures/demo_tight_layout.py @@ -1,10 +1,10 @@ """ =============================== -Resizing axes with tight layout +Resizing Axes with tight layout =============================== `~.Figure.tight_layout` attempts to resize subplots in a figure so that there -are no overlaps between axes objects and labels on the axes. +are no overlaps between Axes objects and labels on the Axes. See :ref:`tight_layout_guide` for more details and :ref:`constrainedlayout_guide` for an alternative. diff --git a/galleries/examples/subplots_axes_and_figures/fahrenheit_celsius_scales.py b/galleries/examples/subplots_axes_and_figures/fahrenheit_celsius_scales.py index 07b447c97521..216641657b06 100644 --- a/galleries/examples/subplots_axes_and_figures/fahrenheit_celsius_scales.py +++ b/galleries/examples/subplots_axes_and_figures/fahrenheit_celsius_scales.py @@ -1,6 +1,6 @@ """ ================================= -Different scales on the same axes +Different scales on the same Axes ================================= Demo of how to display two scales on the left and right y-axis. diff --git a/galleries/examples/subplots_axes_and_figures/figure_title.py b/galleries/examples/subplots_axes_and_figures/figure_title.py index 118157f0579c..85e5044c4eba 100644 --- a/galleries/examples/subplots_axes_and_figures/figure_title.py +++ b/galleries/examples/subplots_axes_and_figures/figure_title.py @@ -3,7 +3,7 @@ Figure labels: suptitle, supxlabel, supylabel ============================================= -Each axes can have a title (or actually three - one each with *loc* "left", +Each Axes can have a title (or actually three - one each with *loc* "left", "center", and "right"), but is sometimes desirable to give a whole figure (or `.SubFigure`) an overall title, using `.Figure.suptitle`. diff --git a/galleries/examples/subplots_axes_and_figures/gridspec_and_subplots.py b/galleries/examples/subplots_axes_and_figures/gridspec_and_subplots.py index bff3ea579e9e..3bfac18cbb89 100644 --- a/galleries/examples/subplots_axes_and_figures/gridspec_and_subplots.py +++ b/galleries/examples/subplots_axes_and_figures/gridspec_and_subplots.py @@ -4,11 +4,11 @@ ================================================== Sometimes we want to combine two subplots in an axes layout created with -`~.Figure.subplots`. We can get the `~.gridspec.GridSpec` from the axes -and then remove the covered axes and fill the gap with a new bigger axes. -Here we create a layout with the bottom two axes in the last column combined. +`~.Figure.subplots`. We can get the `~.gridspec.GridSpec` from the Axes +and then remove the covered Axes and fill the gap with a new bigger Axes. +Here we create a layout with the bottom two Axes in the last column combined. -To start with this layout (rather than removing the overlapping axes) use +To start with this layout (rather than removing the overlapping Axes) use `~.pyplot.subplot_mosaic`. See also :ref:`arranging_axes`. diff --git a/galleries/examples/subplots_axes_and_figures/multiple_figs_demo.py b/galleries/examples/subplots_axes_and_figures/multiple_figs_demo.py index 9bb9962c8e28..5f3d0660a46d 100644 --- a/galleries/examples/subplots_axes_and_figures/multiple_figs_demo.py +++ b/galleries/examples/subplots_axes_and_figures/multiple_figs_demo.py @@ -3,7 +3,7 @@ Managing multiple figures in pyplot =================================== -`matplotlib.pyplot` uses the concept of a *current figure* and *current axes*. +`matplotlib.pyplot` uses the concept of a *current figure* and *current Axes*. Figures are identified via a figure number that is passed to `~.pyplot.figure`. The figure with the given number is set as *current figure*. Additionally, if no figure with the number exists, a new one is created. diff --git a/galleries/examples/subplots_axes_and_figures/share_axis_lims_views.py b/galleries/examples/subplots_axes_and_figures/share_axis_lims_views.py index 751f7effc6a1..234a15660f2d 100644 --- a/galleries/examples/subplots_axes_and_figures/share_axis_lims_views.py +++ b/galleries/examples/subplots_axes_and_figures/share_axis_lims_views.py @@ -6,7 +6,7 @@ with time as a common axis. When you pan and zoom around on one, you want the other to move around with you. To facilitate this, matplotlib Axes support a ``sharex`` and ``sharey`` attribute. When you create a `~.pyplot.subplot` or -`~.pyplot.axes`, you can pass in a keyword indicating what axes you want to +`~.pyplot.axes`, you can pass in a keyword indicating what Axes you want to share with. """ diff --git a/galleries/examples/subplots_axes_and_figures/shared_axis_demo.py b/galleries/examples/subplots_axes_and_figures/shared_axis_demo.py index cfe2d68701f0..6b3b3839a437 100644 --- a/galleries/examples/subplots_axes_and_figures/shared_axis_demo.py +++ b/galleries/examples/subplots_axes_and_figures/shared_axis_demo.py @@ -6,7 +6,7 @@ You can share the x- or y-axis limits for one axis with another by passing an `~.axes.Axes` instance as a *sharex* or *sharey* keyword argument. -Changing the axis limits on one axes will be reflected automatically +Changing the axis limits on one Axes will be reflected automatically in the other, and vice-versa, so when you navigate with the toolbar the Axes will follow each other on their shared axis. Ditto for changes in the axis scaling (e.g., log vs. linear). However, it is diff --git a/galleries/examples/subplots_axes_and_figures/two_scales.py b/galleries/examples/subplots_axes_and_figures/two_scales.py index 857c22d5094d..487ffea13941 100644 --- a/galleries/examples/subplots_axes_and_figures/two_scales.py +++ b/galleries/examples/subplots_axes_and_figures/two_scales.py @@ -3,14 +3,14 @@ Plots with different scales =========================== -Two plots on the same axes with different left and right scales. +Two plots on the same Axes with different left and right scales. -The trick is to use *two different axes* that share the same *x* axis. +The trick is to use *two different Axes* that share the same *x* axis. You can use separate `matplotlib.ticker` formatters and locators as -desired since the two axes are independent. +desired since the two Axes are independent. -Such axes are generated by calling the `.Axes.twinx` method. Likewise, -`.Axes.twiny` is available to generate axes that share a *y* axis but +Such Axes are generated by calling the `.Axes.twinx` method. Likewise, +`.Axes.twiny` is available to generate Axes that share a *y* axis but have different top and bottom scales. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/subplots_axes_and_figures/zoom_inset_axes.py b/galleries/examples/subplots_axes_and_figures/zoom_inset_axes.py index 0d03db15b434..730355ac57e8 100644 --- a/galleries/examples/subplots_axes_and_figures/zoom_inset_axes.py +++ b/galleries/examples/subplots_axes_and_figures/zoom_inset_axes.py @@ -1,9 +1,9 @@ """ ====================== -Zoom region inset axes +Zoom region inset Axes ====================== -Example of an inset axes and a rectangle showing where the zoom is located. +Example of an inset Axes and a rectangle showing where the zoom is located. """ import numpy as np diff --git a/galleries/examples/text_labels_and_annotations/arrow_demo.py b/galleries/examples/text_labels_and_annotations/arrow_demo.py index 9607818181dc..11c6c3ec0e5d 100644 --- a/galleries/examples/text_labels_and_annotations/arrow_demo.py +++ b/galleries/examples/text_labels_and_annotations/arrow_demo.py @@ -23,7 +23,7 @@ def make_arrow_graph(ax, data, size=4, display='length', shape='right', Parameters ---------- ax - The axes where the graph is drawn. + The Axes where the graph is drawn. data Dict with probabilities for the bases and pair transitions. size diff --git a/galleries/examples/text_labels_and_annotations/demo_text_rotation_mode.py b/galleries/examples/text_labels_and_annotations/demo_text_rotation_mode.py index a571a07edf49..a45fae4b6178 100644 --- a/galleries/examples/text_labels_and_annotations/demo_text_rotation_mode.py +++ b/galleries/examples/text_labels_and_annotations/demo_text_rotation_mode.py @@ -7,7 +7,7 @@ of rotated text. Rotated `.Text`\s are created by passing the parameter ``rotation`` to -the constructor or the axes' method `~.axes.Axes.text`. +the constructor or the Axes' method `~.axes.Axes.text`. The actual positioning depends on the additional parameters ``horizontalalignment``, ``verticalalignment`` and ``rotation_mode``. diff --git a/galleries/examples/text_labels_and_annotations/label_subplots.py b/galleries/examples/text_labels_and_annotations/label_subplots.py index fd66d46a5b52..51a4f0eed241 100644 --- a/galleries/examples/text_labels_and_annotations/label_subplots.py +++ b/galleries/examples/text_labels_and_annotations/label_subplots.py @@ -6,7 +6,7 @@ Labelling subplots is relatively straightforward, and varies, so Matplotlib does not have a general method for doing this. -Simplest is putting the label inside the axes. Note, here +Simplest is putting the label inside the Axes. Note, here we use `.pyplot.subplot_mosaic`, and use the subplot labels as keys for the subplots, which is a nice convenience. However, the same method works with `.pyplot.subplots` or keys that are diff --git a/galleries/examples/text_labels_and_annotations/placing_text_boxes.py b/galleries/examples/text_labels_and_annotations/placing_text_boxes.py index f3b07a25e135..7cf49bf6e0bb 100644 --- a/galleries/examples/text_labels_and_annotations/placing_text_boxes.py +++ b/galleries/examples/text_labels_and_annotations/placing_text_boxes.py @@ -2,7 +2,7 @@ Placing text boxes ================== -When decorating axes with text boxes, two useful tricks are to place the text +When decorating Axes with text boxes, two useful tricks are to place the text in axes coordinates (see :ref:`transforms_tutorial`), so the text doesn't move around with changes in x or y limits. You can also use the ``bbox`` property of text to surround the text with a diff --git a/galleries/examples/text_labels_and_annotations/titles_demo.py b/galleries/examples/text_labels_and_annotations/titles_demo.py index 7202ac9115ff..6fc0e350fdb2 100644 --- a/galleries/examples/text_labels_and_annotations/titles_demo.py +++ b/galleries/examples/text_labels_and_annotations/titles_demo.py @@ -4,7 +4,7 @@ ================= Matplotlib can display plot titles centered, flush with the left side of -a set of axes, and flush with the right side of a set of axes. +a set of Axes, and flush with the right side of a set of Axes. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/ticks/colorbar_tick_labelling_demo.py b/galleries/examples/ticks/colorbar_tick_labelling_demo.py index 8a1e5b28043d..b8268d4271dd 100644 --- a/galleries/examples/ticks/colorbar_tick_labelling_demo.py +++ b/galleries/examples/ticks/colorbar_tick_labelling_demo.py @@ -6,7 +6,7 @@ Vertical colorbars have ticks, tick labels, and labels visible on the *y* axis, horizontal colorbars on the *x* axis. The ``ticks`` parameter can be used to set the ticks and the ``format`` parameter can be used to format the tick labels -of the visible colorbar axes. For further adjustments, the ``yaxis`` or +of the visible colorbar Axes. For further adjustments, the ``yaxis`` or ``xaxis`` axes of the colorbar can be retrieved using its ``ax`` property. """ import matplotlib.pyplot as plt diff --git a/galleries/examples/widgets/multicursor.py b/galleries/examples/widgets/multicursor.py index 3a80b9ef8230..bc0d58b6c749 100644 --- a/galleries/examples/widgets/multicursor.py +++ b/galleries/examples/widgets/multicursor.py @@ -5,9 +5,9 @@ Showing a cursor on multiple plots simultaneously. -This example generates three axes split over two different figures. On +This example generates three Axes split over two different figures. On hovering the cursor over data in one subplot, the values of that datapoint are -shown in all axes. +shown in all Axes. """ import matplotlib.pyplot as plt diff --git a/galleries/users_explain/artists/color_cycle.py b/galleries/users_explain/artists/color_cycle.py index 715b75a88ff4..9618b5d6381b 100644 --- a/galleries/users_explain/artists/color_cycle.py +++ b/galleries/users_explain/artists/color_cycle.py @@ -18,8 +18,8 @@ This example demonstrates two different APIs: 1. Setting the rc parameter specifying the default property cycle. - This affects all subsequent axes (but not axes already created). -2. Setting the property cycle for a single pair of axes. + This affects all subsequent Axes (but not Axes already created). +2. Setting the property cycle for a single pair of Axes. """ from cycler import cycler diff --git a/galleries/users_explain/artists/imshow_extent.py b/galleries/users_explain/artists/imshow_extent.py index d222af6aee26..b4529ab5b57f 100644 --- a/galleries/users_explain/artists/imshow_extent.py +++ b/galleries/users_explain/artists/imshow_extent.py @@ -11,7 +11,7 @@ will be used as-is) to a rectangular region in data space. The orientation of the image in the final rendering is controlled by the *origin* and *extent* keyword arguments (and attributes on the resulting `.AxesImage` instance) and -the data limits of the axes. +the data limits of the Axes. The *extent* keyword arguments controls the bounding box in data coordinates that the image will fill specified as ``(left, right, bottom, top)`` in **data diff --git a/galleries/users_explain/artists/transforms_tutorial.py b/galleries/users_explain/artists/transforms_tutorial.py index a39cf7a30192..29719755cd6a 100644 --- a/galleries/users_explain/artists/transforms_tutorial.py +++ b/galleries/users_explain/artists/transforms_tutorial.py @@ -32,8 +32,8 @@ +----------------+-----------------------------------+-----------------------------+ |"axes" |The coordinate system of the |``ax.transAxes`` | | |`~matplotlib.axes.Axes`; (0, 0) | | -| |is bottom left of the axes, and | | -| |(1, 1) is top right of the axes. | | +| |is bottom left of the Axes, and | | +| |(1, 1) is top right of the Axes. | | +----------------+-----------------------------------+-----------------------------+ |"subfigure" |The coordinate system of the |``subfigure.transSubfigure`` | | |`.SubFigure`; (0, 0) is bottom left| | @@ -104,7 +104,7 @@ ================ Let's start with the most commonly used coordinate, the *data* coordinate -system. Whenever you add data to the axes, Matplotlib updates the datalimits, +system. Whenever you add data to the Axes, Matplotlib updates the datalimits, most commonly updated with the :meth:`~matplotlib.axes.Axes.set_xlim` and :meth:`~matplotlib.axes.Axes.set_ylim` methods. For example, in the figure below, the data limits stretch from 0 to 10 on the x-axis, and -1 to 1 on the diff --git a/galleries/users_explain/axes/arranging_axes.py b/galleries/users_explain/axes/arranging_axes.py index 8068d3b92ad3..538bde570083 100644 --- a/galleries/users_explain/axes/arranging_axes.py +++ b/galleries/users_explain/axes/arranging_axes.py @@ -75,7 +75,7 @@ location: `~matplotlib.figure.Figure.add_axes` - Adds a single axes at a location specified by + Adds a single Axes at a location specified by ``[left, bottom, width, height]`` in fractions of figure width or height. `~matplotlib.pyplot.subplot` or `.Figure.add_subplot` diff --git a/galleries/users_explain/axes/autoscale.py b/galleries/users_explain/axes/autoscale.py index a9d6b728866c..d91ca6304252 100644 --- a/galleries/users_explain/axes/autoscale.py +++ b/galleries/users_explain/axes/autoscale.py @@ -7,7 +7,7 @@ =========== The limits on an axis can be set manually (e.g. ``ax.set_xlim(xmin, xmax)``) -or Matplotlib can set them automatically based on the data already on the axes. +or Matplotlib can set them automatically based on the data already on the Axes. There are a number of options to this autoscaling behaviour, discussed below. """ diff --git a/galleries/users_explain/axes/colorbar_placement.py b/galleries/users_explain/axes/colorbar_placement.py index 1e43d4940a98..91d6e1b113bc 100644 --- a/galleries/users_explain/axes/colorbar_placement.py +++ b/galleries/users_explain/axes/colorbar_placement.py @@ -13,8 +13,8 @@ Automatic placement of colorbars ================================ -The simplest case is just attaching a colorbar to each axes. Note in this -example that the colorbars steal some space from the parent axes. +The simplest case is just attaching a colorbar to each Axes. Note in this +example that the colorbars steal some space from the parent Axes. """ import matplotlib.pyplot as plt import numpy as np diff --git a/lib/matplotlib/backends/qt_compat.py b/lib/matplotlib/backends/qt_compat.py index d587223ab9cf..5f269aee6bf6 100644 --- a/lib/matplotlib/backends/qt_compat.py +++ b/lib/matplotlib/backends/qt_compat.py @@ -215,6 +215,8 @@ def _may_clear_sock(*args): def handle(*args): nonlocal handler_args handler_args = args + for window in qapp.allWindows(): + window.close() qapp.quit() signal.signal(signal.SIGINT, handle) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index 2b83a7ae4a73..59f52dddc20d 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -69,7 +69,7 @@ def _stale_figure_callback(self, val): class _AxesStack: """ - Helper class to track axes in a figure. + Helper class to track Axes in a figure. Axes are tracked both in the order in which they have been added (``self._axes`` insertion/iteration order) and in the separate "gca" stack @@ -81,26 +81,26 @@ def __init__(self): self._counter = itertools.count() def as_list(self): - """List the axes that have been added to the figure.""" + """List the Axes that have been added to the figure.""" return [*self._axes] # This relies on dict preserving order. def remove(self, a): - """Remove the axes from the stack.""" + """Remove the given Axes from the stack.""" self._axes.pop(a) def bubble(self, a): - """Move an axes, which must already exist in the stack, to the top.""" + """Move an Axes, which must already exist in the stack, to the top.""" if a not in self._axes: raise ValueError("Axes has not been added yet") self._axes[a] = next(self._counter) def add(self, a): - """Add an axes to the stack, ignoring it if already present.""" + """Add an Axes to the stack, ignoring it if already present.""" if a not in self._axes: self._axes[a] = next(self._counter) def current(self): - """Return the active axes, or None if the stack is empty.""" + """Return the active Axes, or None if the stack is empty.""" return max(self._axes, key=self._axes.__getitem__, default=None) def __getstate__(self):