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
@@ -426,11 +427,12 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs):
426
427
Parameters
427
428
----------
428
429
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>))``.
432
432
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.
434
436
pack_start : bool
435
437
If False, the new axes is appended at the end
436
438
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):
442
444
main axes will be used.
443
445
"""
444
446
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
449
448
if pad :
450
449
if not isinstance (pad , Size ._Base ):
451
450
pad = Size .from_any (pad , fraction_ref = self ._xref )
@@ -475,11 +474,12 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
475
474
Parameters
476
475
----------
477
476
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>))``.
481
479
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.
483
483
pack_start : bool
484
484
If False, the new axes is appended at the end
485
485
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):
491
491
main axes will be used.
492
492
"""
493
493
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
498
495
if pad :
499
496
if not isinstance (pad , Size ._Base ):
500
497
pad = Size .from_any (pad , fraction_ref = self ._yref )
0 commit comments