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
@@ -434,11 +435,12 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs):
434435 Parameters
435436 ----------
436437 size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
437- A width of the axes. If float or string is given, *from_any*
438- function is used to create the size, with *ref_size* set to AxesX
439- instance of the current axes.
438+ The axes width. float or str arguments are interpreted as
439+ ``axes_size.from_any(size, AxesX(<main_axes>))``.
440440 pad : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
441- Pad between the axes. It takes same argument as *size*.
441+ Padding between the axes. float or str arguments are interpreted
442+ as ``axes_size.from_any(size, AxesX(<main_axes>))``. Defaults to
443+ :rc:`figure.subplot.wspace` times the main axes width.
442444 pack_start : bool
443445 If False, the new axes is appended at the end
444446 of the list, i.e., it became the right-most axes. If True, it is
@@ -450,10 +452,7 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs):
450452 main axes will be used.
451453 """
452454 if pad is None :
453- _api .warn_deprecated (
454- "3.2" , message = "In a future version, 'pad' will default to "
455- "rcParams['figure.subplot.wspace']. Set pad=0 to keep the "
456- "old behavior." )
455+ pad = mpl .rcParams ["figure.subplot.wspace" ] * self ._xref
457456 if pad :
458457 if not isinstance (pad , Size ._Base ):
459458 pad = Size .from_any (pad , fraction_ref = self ._xref )
@@ -483,11 +482,12 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
483482 Parameters
484483 ----------
485484 size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
486- A height of the axes. If float or string is given, *from_any*
487- function is used to create the size, with *ref_size* set to AxesX
488- instance of the current axes.
485+ The axes height. float or str arguments are interpreted as
486+ ``axes_size.from_any(size, AxesY(<main_axes>))``.
489487 pad : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
490- Pad between the axes. It takes same argument as *size*.
488+ Padding between the axes. float or str arguments are interpreted
489+ as ``axes_size.from_any(size, AxesY(<main_axes>))``. Defaults to
490+ :rc:`figure.subplot.hspace` times the main axes height.
491491 pack_start : bool
492492 If False, the new axes is appended at the end
493493 of the list, i.e., it became the right-most axes. If True, it is
@@ -499,10 +499,7 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
499499 main axes will be used.
500500 """
501501 if pad is None :
502- _api .warn_deprecated (
503- "3.2" , message = "In a future version, 'pad' will default to "
504- "rcParams['figure.subplot.hspace']. Set pad=0 to keep the "
505- "old behavior." )
502+ pad = mpl .rcParams ["figure.subplot.hspace" ] * self ._yref
506503 if pad :
507504 if not isinstance (pad , Size ._Base ):
508505 pad = Size .from_any (pad , fraction_ref = self ._yref )
0 commit comments