MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / axes

Function axes

lib/matplotlib/pyplot.py:1366–1452  ·  view source on GitHub ↗

Add an Axes to the current figure and make it the current Axes. Call signatures:: plt.axes() plt.axes(rect, projection=None, polar=False, **kwargs) plt.axes(ax) Parameters ---------- arg : None or 4-tuple The exact behavior of this function dep

(
    arg: None | tuple[float, float, float, float] = None,
    **kwargs
)

Source from the content-addressed store, hash-verified

1364
1365@_docstring.interpd
1366def axes(
1367 arg: None | tuple[float, float, float, float] = None,
1368 **kwargs
1369) -> matplotlib.axes.Axes:
1370 """
1371 Add an Axes to the current figure and make it the current Axes.
1372
1373 Call signatures::
1374
1375 plt.axes()
1376 plt.axes(rect, projection=None, polar=False, **kwargs)
1377 plt.axes(ax)
1378
1379 Parameters
1380 ----------
1381 arg : None or 4-tuple
1382 The exact behavior of this function depends on the type:
1383
1384 - *None*: A new full window Axes is added using
1385 ``subplot(**kwargs)``.
1386 - 4-tuple of float *rect* = ``(left, bottom, width, height)``.
1387 A new Axes is added with dimensions *rect* in normalized
1388 (0, 1) units using `~.Figure.add_axes` on the current figure.
1389
1390 projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \
1391'polar', 'rectilinear', str}, optional
1392 The projection type of the `~.axes.Axes`. *str* is the name of
1393 a custom projection, see `~matplotlib.projections`. The default
1394 None results in a 'rectilinear' projection.
1395
1396 polar : bool, default: False
1397 If True, equivalent to projection='polar'.
1398
1399 sharex, sharey : `~matplotlib.axes.Axes`, optional
1400 Share the x or y `~matplotlib.axis` with sharex and/or sharey.
1401 The axis will have the same limits, ticks, and scale as the axis
1402 of the shared Axes.
1403
1404 label : str
1405 A label for the returned Axes.
1406
1407 Returns
1408 -------
1409 `~.axes.Axes`, or a subclass of `~.axes.Axes`
1410 The returned Axes class depends on the projection used. It is
1411 `~.axes.Axes` if rectilinear projection is used and
1412 `.projections.polar.PolarAxes` if polar projection is used.
1413
1414 Other Parameters
1415 ----------------
1416 **kwargs
1417 This method also takes the keyword arguments for
1418 the returned Axes class. The keyword arguments for the
1419 rectilinear Axes class `~.axes.Axes` can be found in
1420 the following table but there might also be other keyword
1421 arguments if another projection is used, see the actual Axes
1422 class.
1423

Callers 1

polarFunction · 0.85

Calls 4

gcfFunction · 0.85
add_subplotMethod · 0.80
add_axesMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…