8000 Add note about hist2d resetting axis limits · matplotlib/matplotlib@12d30e5 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 12d30e5

Browse files
committed
Add note about hist2d resetting axis limits
1 parent db3be23 commit 12d30e5

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 16 additions & 14 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,33 @@ 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
6513+
A :class:`.colors.Colormap` instance. If not set, use rc
65146514
settings.
65156515
65166516
norm : Normalize, optional
6517-
A :class:`matplotlib.colors.Normalize` instance is used to
6517+
A :class:`.colors.Normalize` instance is used to
65186518
scale luminance data to ``[0, 1]``. If not set, defaults to
6519-
``Normalize()``.
6519+
:class:`.colors.Normalize()`.
65206520
65216521
vmin/vmax : None or scalar, optional
6522-
Arguments passed to the `Normalize` instance.
6522+
Arguments passed to the :class:`~.colors.Normalize` instance.
65236523
65246524
alpha : ``0 <= scalar <= 1`` or ``None``, optional
65256525
The alpha blending value.
65266526
65276527
See also
65286528
--------
6529-
hist : 1D histogram
6529+
hist : 1D histogram plotting
65306530
65316531
Notes
65326532
-----
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`.
6533+
- Currently ``hist2d`` calculates it's own axis limits, and any limits
6534+
previously set are ignored.
6535+
- Rendering the histogram with a logarithmic color scale is
6536+
accomplished by passing a :class:`.colors.LogNorm` instance to
6537+
the *norm* keyword argument. Likewise, power-law normalization
6538+
(similar in effect to gamma correction) can be accomplished with
6539+
:class:`.colors.PowerNorm`.
65386540
"""
65396541

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

0 commit comments

Comments
 (0)
0