Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff8cc81

Browse files
authored
Merge pull request #11071 from dstansby/hist-scaling
Add note about hist2d resetting axis limits
2 parents 8a4c0b2 + 4e1035e commit ff8cc81

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6462,21 +6462,21 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
64626462
- If int, the number of bins for the two dimensions
64636463
(nx=ny=bins).
64646464
6465-
- If [int, int], the number of bins in each dimension
6465+
- If ``[int, int]``, the number of bins in each dimension
64666466
(nx, ny = bins).
64676467
64686468
- If array_like, the bin edges for the two dimensions
64696469
(x_edges=y_edges=bins).
64706470
6471-
- If [array, array], the bin edges in each dimension
6471+
- If ``[array, array]``, the bin edges in each dimension
64726472
(x_edges, y_edges = bins).
64736473
64746474
The default value is 10.
64756475
64766476
range : array_like shape(2, 2), optional, default: None
64776477
The leftmost and rightmost edges of the bins along each dimension
6478-
(if not specified explicitly in the bins parameters): [[xmin,
6479-
xmax], [ymin, ymax]]. All values outside of this range will be
6478+
(if not specified explicitly in the bins parameters): ``[[xmin,
6479+
xmax], [ymin, ymax]]``. All values outside of this range will be
64806480
considered outliers and not tallied in the histogram.
64816481
64826482
normed : bool, optional, default: False
@@ -6510,31 +6510,32 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
65106510
Other Parameters
65116511
----------------
65126512
cmap : Colormap or str, optional
6513-
A :class:`matplotlib.colors.Colormap` instance. If not set, use rc
6514-
settings.
6513+
A `.colors.Colormap` instance. If not set, use rc settings.
65156514
65166515
norm : Normalize, optional
6517-
A :class:`matplotlib.colors.Normalize` instance is used to
6516+
A `.colors.Normalize` instance is used to
65186517
scale luminance data to ``[0, 1]``. If not set, defaults to
6519-
``Normalize()``.
6518+
`.colors.Normalize()`.
65206519
65216520
vmin/vmax : None or scalar, optional
6522-
Arguments passed to the `Normalize` instance.
6521+
Arguments passed to the `~.colors.Normalize` instance.
65236522
65246523
alpha : ``0 <= scalar <= 1`` or ``None``, optional
65256524
The alpha blending value.
65266525
65276526
See also
65286527
--------
6529-
hist : 1D histogram
6528+
hist : 1D histogram plotting
65306529
65316530
Notes
65326531
-----
6533-
Rendering the histogram with a logarithmic color scale is
6534-
accomplished by passing a :class:`colors.LogNorm` instance to
6535-
the *norm* keyword argument. Likewise, power-law normalization
6536-
(similar in effect to gamma correction) can be accomplished with
6537-
:class:`colors.PowerNorm`.
6532+
- Currently ``hist2d`` calculates it's own axis limits, and any limits
6533+
previously set are ignored.
6534+
- Rendering the histogram with a logarithmic color scale is
6535+
accomplished by passing a `.colors.LogNorm` instance to the *norm*
6536+
keyword argument. Likewise, power-law normalization (similar
6537+
in effect to gamma correction) can be accomplished with
6538+
`.colors.PowerNorm`.
65386539
"""
65396540

65406541
h, xedges, yedges = np.histogram2d(x, y, bins=bins, range=range,

0 commit comments

Comments
 (0)