44
55import numpy as np
66
7+ import matplotlib as mpl
78from matplotlib import _api
89from matplotlib .axes import SubplotBase
910from matplotlib .gridspec import SubplotSpec , GridSpec
@@ -426,11 +427,12 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs):
426427 Parameters
427428 ----------
428429 size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
429- A width of the axes. If float or string is given, *from_any*
430- function is used to create the size, with *ref_size* set to AxesX
431- instance of the current axes.
430+ The axes width. float or str arguments are interpreted as
431+ ``axes_size.from_any(size, AxesX(<main_axes>))``.
432432 pad : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
433- Pad between the axes. It takes same argument as *size*.
433+ Padding between the axes. float or str arguments are interpreted
434+ as ``axes_size.from_any(size, AxesX(<main_axes>))``. Defaults to
435+ :rc:`figure.subplot.wspace` times the main axes width.
434436 pack_start : bool
435437 If False, the new axes is appended at the end
436438 of the list, i.e., it became the right-most axes. If True, it is
@@ -442,10 +444,7 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs):
442444 main axes will be used.
443445 """
444446 if pad is None :
445- _api .warn_deprecated (
446- "3.2" , message = "In a future version, 'pad' will default to "
447- "rcParams['figure.subplot.wspace']. Set pad=0 to keep the "
448- "old behavior." )
447+ pad = mpl .rcParams ["figure.subplot.wspace" ] * self ._xref
449448 if pad :
450449 if not isinstance (pad , Size ._Base ):
451450 pad = Size .from_any (pad , fraction_ref = self ._xref )
@@ -475,11 +474,12 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
475474 Parameters
476475 ----------
477476 size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
478- A height of the axes. If float or string is given, *from_any*
479- function is used to create the size, with *ref_size* set to AxesX
480- instance of the current axes.
477+ The axes height. float or str arguments are interpreted as
478+ ``axes_size.from_any(size, AxesY(<main_axes>))``.
481479 pad : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
482- Pad between the axes. It takes same argument as *size*.
480+ Padding between the axes. float or str arguments are interpreted
481+ as ``axes_size.from_any(size, AxesY(<main_axes>))``. Defaults to
482+ :rc:`figure.subplot.hspace` times the main axes height.
483483 pack_start : bool
484484 If False, the new axes is appended at the end
485485 of the list, i.e., it became the right-most axes. If True, it is
@@ -491,10 +491,7 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
491491 main axes will be used.
492492 """
493493 if pad is None :
494- _api .warn_deprecated (
495- "3.2" , message = "In a future version, 'pad' will default to "
496- "rcParams['figure.subplot.hspace']. Set pad=0 to keep the "
497- "old behavior." )
494+ pad = mpl .rcParams ["figure.subplot.hspace" ] * self ._yref
498495 if pad :
499496 if not isinstance (pad , Size ._Base ):
500497 pad = Size .from_any (pad , fraction_ref = self ._yref )
0 commit comments