8000 Merge pull request #22075 from anntzer/unfig · matplotlib/matplotlib@d1216c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit d1216c2

Browse files
authored
Merge pull request #22075 from anntzer/unfig
Remove unnecessary `.figure` qualifier in docs.
2 parents 62a6ae4 + fb0f742 commit d1216c2

File tree

12 files changed

+33
-36
lines changed

12 files changed

+33
-36
lines changed

doc/users/explain/interactive.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ that include interactive tools, a toolbar, a tool-tip, and
2828
:ref:`key bindings <key-event-handling>`:
2929

3030
`.pyplot.figure`
31-
Creates a new empty `.figure.Figure` or selects an existing figure
31+
Creates a new empty `.Figure` or selects an existing figure
3232

3333
`.pyplot.subplots`
34-
Creates a new `.figure.Figure` and fills it with a grid of `.axes.Axes`
34+
Creates a new `.Figure` and fills it with a grid of `~.axes.Axes`
3535

3636
`.pyplot` has a notion of "The Current Figure" which can be accessed
3737
through `.pyplot.gcf` and a notion of "The Current Axes" accessed
3838
through `.pyplot.gca`. Almost all of the functions in `.pyplot` pass
39-
through the current `.Figure` / `.axes.Axes` (or create one) as
39+
through the current `.Figure` / `~.axes.Axes` (or create one) as
4040
appropriate.
4141

4242
Matplotlib keeps a reference to all of the open figures
@@ -184,7 +184,7 @@ the GUI main loop in some other way.
184184

185185
.. warning::
186186

187-
Using `.figure.Figure.show` it is possible to display a figure on
187+
Using `.Figure.show` it is possible to display a figure on
188188
the screen without starting the event loop and without being in
189189
interactive mode. This may work (depending on the GUI toolkit) but
190190
will likely result in a non-responsive figure.

doc/users/explain/interactive_guide.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Blocking functions
213213
------------------
214214

215215
If you only need to collect points in an Axes you can use
216-
`.figure.Figure.ginput` or more generally the tools from
216+
`.Figure.ginput` or more generally the tools from
217217
`.blocking_input` the tools will take care of starting and stopping
218218
the event loop for you. However if you have written some custom event
219219
handling or are using `.widgets` you will need to manually run the GUI
@@ -315,7 +315,7 @@ Artists (as of Matplotlib 1.5) have a **stale** attribute which is
315315
`True` if the internal state of the artist has changed since the last
316316
time it was rendered. By default the stale state is propagated up to
317317
the Artists parents in the draw tree, e.g., if the color of a `.Line2D`
318-
instance is changed, the `.axes.Axes` and `.figure.Figure` that
318+
instance is changed, the `~.axes.Axes` and `.Figure` that
319319
contain it will also be marked as "stale". Thus, ``fig.stale`` will
320320
report if any artist in the figure has been modified and is out of sync
321321
with what is displayed on the screen. This is intended to be used to
@@ -332,11 +332,11 @@ which by default is set to a function that forwards the stale state to
332332
the artist's parent. If you wish to suppress a given artist from propagating
333333
set this attribute to None.
334334

335-
`.figure.Figure` instances do not have a containing artist and their
335+
`.Figure` instances do not have a containing artist and their
336336
default callback is `None`. If you call `.pyplot.ion` and are not in
337337
``IPython`` we will install a callback to invoke
338338
`~.backend_bases.FigureCanvasBase.draw_idle` whenever the
339-
`.figure.Figure` becomes stale. In ``IPython`` we use the
339+
`.Figure` becomes stale. In ``IPython`` we use the
340340
``'post_execute'`` hook to invoke
341341
`~.backend_bases.FigureCanvasBase.draw_idle` on any stale figures
342342
after having executed the user's input, but before returning the prompt

examples/color/colorbar_basics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Colorbar
44
========
55
6-
Use `~.figure.Figure.colorbar` by specifying the mappable object (here
7-
the `~.matplotlib.image.AxesImage` returned by `~.axes.Axes.imshow`)
6+
Use `~.Figure.colorbar` by specifying the mappable object (here
7+
the `.AxesImage` returned by `~.axes.Axes.imshow`)
88
and the axes to attach the colorbar to.
99
"""
1010

examples/subplots_axes_and_figures/demo_tight_layout.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
Resizing axes with tight layout
44
===============================
55
6-
`~.figure.Figure.tight_layout` attempts to resize subplots in
7-
a figure so that there are no overlaps between axes objects and labels
8-
on the axes.
6+
`~.Figure.tight_layout` attempts to resize subplots in a figure so that there
7+
are no overlaps between axes objects and labels on the axes.
98
109
See :doc:`/tutorials/intermediate/tight_layout_guide` for more details and
1110
:doc:`/tutorials/intermediate/constrainedlayout_guide` for an alternative.

examples/subplots_axes_and_figures/gridspec_nested.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set the position for a nested grid of subplots.
88
99
Note that the same functionality can be achieved more directly with
10-
`~.figure.FigureBase.subfigures`; see
10+
`~.FigureBase.subfigures`; see
1111
:doc:`/gallery/subplots_axes_and_figures/subfigures`.
1212
1313
"""

lib/matplotlib/figure.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ def update(self, left=None, bottom=None, right=None, top=None,
180180

181181
class FigureBase(Artist):
182182
"""
183-
Base class for `.figure.Figure` and `.figure.SubFigure` containing the
184-
methods that add artists to the figure or subfigure, create Axes, etc.
183+
Base class for `.Figure` and `.SubFigure` containing the methods that add
184+
artists to the figure or subfigure, create Axes, etc.
185185
"""
186186
def __init__(self, **kwargs):
187187
super().__init__()
@@ -1453,8 +1453,7 @@ def subfigures(self, nrows=1, ncols=1, squeeze=True,
14531453

14541454
def add_subfigure(self, subplotspec, **kwargs):
14551455
"""
1456-
Add a `~.figure.SubFigure` to the figure as part of a subplot
1457-
arrangement.
1456+
Add a `.SubFigure` to the figure as part of a subplot arrangement.
14581457
14591458
Parameters
14601459
----------
@@ -1464,12 +1463,12 @@ def add_subfigure(self, subplotspec, **kwargs):
14641463
14651464
Returns
14661465
-------
1467-
`.figure.SubFigure`
1466+
`.SubFigure`
14681467
14691468
Other Parameters
14701469
----------------
14711470
**kwargs
1472-
Are passed to the `~.figure.SubFigure` object.
1471+
Are passed to the `.SubFigure` object.
14731472
14741473
See Also
14751474
--------
@@ -1964,7 +1963,7 @@ def __init__(self, parent, subplotspec, *,
19641963
"""
19651964
Parameters
19661965
----------
1967-
parent : `.figure.Figure` or `.figure.SubFigure`
1966+
parent : `.Figure` or `.SubFigure`
19681967
Figure or subfigure that contains the SubFigure. SubFigures
19691968
can be nested.
19701969

lib/matplotlib/gridspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def __init__(self, nrows, ncols, figure=None,
344344
nrows, ncols : int
345345
The number of rows and columns of the grid.
346346
347-
figure : `~.figure.Figure`, optional
347+
figure : `.Figure`, optional
348348
Only used for constrained layout to create a proper layoutgrid.
349349
350350
left, right, top, bottom : float, optional

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear',
17481748
17491749
Returns
17501750
-------
1751-
`~.figure.Figure`
1751+
`.Figure`
17521752
The figure instance containing the thumbnail.
17531753
"""
17541754

lib/matplotlib/pyplot.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,13 +1363,12 @@ def subplots(nrows=1, ncols=1, *, sharex=False, sharey=False, squeeze=True,
13631363
13641364
Returns
13651365
-------
1366-
fig : `~.figure.Figure`
1366+
fig : `.Figure`
13671367
1368-
ax : `.axes.Axes` or array of Axes
1369-
*ax* can be either a single `~matplotlib.axes.Axes` object or an
1370-
array of Axes objects if more than one subplot was created. The
1371-
dimensions of the resulting array can be controlled with the squeeze
1372-
keyword, see above.
1368+
ax : `~.axes.Axes` or array of Axes
1369+
*ax* can be either a single `~.axes.Axes` object, or an array of Axes
1370+
objects if more than one subplot was created. The dimensions of the
1371+
resulting array can be controlled with the squeeze keyword, see above.
13731372
13741373
Typical idioms for handling the return value are::
13751374
@@ -1516,7 +1515,7 @@ def subplot_mosaic(mosaic, *, sharex=False, sharey=False,
15161515
15171516
Returns
15181517
-------
1519-
fig : `~.figure.Figure`
1518+
fig : `.Figure`
15201519
The new figure
15211520
15221521
dict[label, Axes]

tutorials/intermediate/arranging_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=====================================
2+
===================================
33
Arranging multiple Axes in a Figure
4-
=====================================
4+
===================================
55
66
Often more than one Axes is wanted on a figure at a time, usually
77
organized into a regular grid. Matplotlib has a variety of tools for
@@ -37,7 +37,7 @@
3737
`.Figure.subplot_mosaic` and :doc:`/tutorials/provisional/mosaic`.
3838
3939
Sometimes it is natural to have more than one distinct group of Axes grids,
40-
in which case Matplotlib has the concept of `~.figure.SubFigure`:
40+
in which case Matplotlib has the concept of `.SubFigure`:
4141
4242
`~matplotlib.figure.SubFigure`
4343
A virtual figure within a figure.

tutorials/intermediate/constrainedlayout_guide.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
142142
# Suptitle
143143
# =========
144144
#
145-
# ``constrained_layout`` can also make room for `~.figure.Figure.suptitle`.
145+
# ``constrained_layout`` can also make room for `~.Figure.suptitle`.
146146

147147
fig, axs = plt.subplots(2, 2, figsize=(4, 4), constrained_layout=True)
148148
for ax in axs.flat:
@@ -228,7 +228,7 @@ def example_plot(ax, fontsize=12, hide_labels=False):
228228
#
229229
# Padding between axes is controlled in the horizontal by *w_pad* and
230230
# *wspace*, and vertical by *h_pad* and *hspace*. These can be edited
231-
# via `~.figure.Figure.set_constrained_layout_pads`. *w/h_pad* are
231+
# via `~.Figure.set_constrained_layout_pads`. *w/h_pad* are
232232
# the minimum space around the axes in units of inches:
233233

234234
fig, axs = plt.subplots(2, 2, constrained_layout=True)

tutorials/introductory/usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# A simple example
1818
# ================
1919
#
20-
# Matplotlib graphs your data on `~.figure.Figure`\s (e.g., windows, Jupyter
20+
# Matplotlib graphs your data on `.Figure`\s (e.g., windows, Jupyter
2121
# widgets, etc.), each of which can contain one or more `~.axes.Axes`, an
2222
# area where points can be specified in terms of x-y coordinates (or theta-r
2323
# in a polar plot, x-y-z in a 3D plot, etc). The simplest way of

0 commit comments

Comments
 (0)
0