4
4
5
5
import numpy as np
6
6
7
+ import matplotlib as mpl
7
8
from matplotlib import _api
8
9
from matplotlib .axes import SubplotBase
9
10
from matplotlib .gridspec import SubplotSpec , GridSpec
@@ -434,11 +435,12 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs):
434
435
Parameters
435
436
----------
436
437
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(self))``.
440
440
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(self))``. Defaults to
443
+ :rc:`figure.subplot.wspace` times the current axes width.
442
444
pack_start : bool
443
445
If False, the new axes is appended at the end
444
446
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):
450
452
main axes will be used.
451
453
"""
452
454
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
457
456
if pad :
458
457
if not isinstance (pad , Size ._Base ):
459
458
pad = Size .from_any (pad , fraction_ref = self ._xref )
@@ -483,11 +482,12 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
483
482
Parameters
484
483
----------
485
484
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(self))``.
489
487
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(self))``. Defaults to
490
+ :rc:`figure.subplot.hspace` times the current axes height.
491
491
pack_start : bool
492
492
If False, the new axes is appended at the end
493
493
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):
499
499
main axes will be used.
500
500
"""
501
501
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
506
503
if pad :
507
504
if not isinstance (pad , Size ._Base ):
508
505
pad = Size .from_any (pad , fraction_ref = self ._yref )
0 commit comments