| [ Web Proxy ] |
| Viewing: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist2d.html#matplotlib.pyplot.hist2d | [Back] [Original] |
Section Navigation
matplotlibmatplotlib.animationmatplotlib.artistmatplotlib.axesmatplotlib.axismatplotlib.backend_basesmatplotlib.backend_managersmatplotlib.backend_toolsmatplotlib.backendsmatplotlib.backends.backend_mixedmatplotlib.backends.backend_templatematplotlib.backends.backend_aggmatplotlib.backends.backend_cairomatplotlib.backends.backend_gtk3agg, matplotlib.backends.backend_gtk3cairomatplotlib.backends.backend_gtk4agg, matplotlib.backends.backend_gtk4cairomatplotlib.backends.backend_nbaggmatplotlib.backends.backend_pdfmatplotlib.backends.backend_pgfmatplotlib.backends.backend_psmatplotlib.backends.registrymatplotlib.backends.backend_qtagg, matplotlib.backends.backend_qtcairomatplotlib.backends.backend_svgmatplotlib.backends.backend_tkagg, matplotlib.backends.backend_tkcairomatplotlib.backends.backend_webagg_corematplotlib.backends.backend_webaggmatplotlib.backends.backend_wxagg, matplotlib.backends.backend_wxcairomatplotlib.beziermatplotlib.categorymatplotlib.cbookmatplotlib.cmmatplotlib.collectionsmatplotlib.colorbarmatplotlib.colorizermatplotlib.colorsmatplotlib.containermatplotlib.contourmatplotlib.datesmatplotlib.dvireadmatplotlib.figurematplotlib.font_managermatplotlib.ft2fontmatplotlib.gridspec
matplotlib.hatchmatplotlib.imagematplotlib.insetmatplotlib.layout_enginematplotlib.legendmatplotlib.legend_handlermatplotlib.lines
matplotlib.markers
matplotlib.mathtextmatplotlib.mlabmatplotlib.offsetboxmatplotlib.patchesmatplotlib.pathmatplotlib.patheffectsmatplotlib.pyplotmatplotlib.projections
matplotlib.quiver
matplotlib.rcsetupmatplotlib.sankeymatplotlib.scalematplotlib.sphinxext.mathmplmatplotlib.sphinxext.plot_directivematplotlib.sphinxext.figmpl_directivematplotlib.sphinxext.rolesmatplotlib.spinesmatplotlib.stylematplotlib.tablematplotlib.testingmatplotlib.textmatplotlib.texmanagermatplotlib.tickermatplotlib.transformsmatplotlib.trimatplotlib.typingmatplotlib.unitsmatplotlib.widgetsmatplotlib._afmmatplotlib._apimatplotlib._docstringmatplotlib._enumsmatplotlib._type1fontmatplotlib._tight_bboxmatplotlib._tight_layoutmpl_toolkits.mplot3dmpl_toolkits.axes_grid1mpl_toolkits.axisartistpylabmatplotlib.pyplotMake a 2D histogram plot.
Input values
The bin specification:
If int, the number of bins for the two dimensions
(nx = ny = bins).
If [int, int], the number of bins in each dimension
(nx, ny = bins).
If array-like, the bin edges for the two dimensions
(x_edges = y_edges = bins).
If [array, array], the bin edges in each dimension
(x_edges, y_edges = bins).
The default value is 10.
The leftmost and rightmost edges of the bins along each dimension
(if not specified explicitly in the bins parameters): [[xmin,
xmax], [ymin, ymax]]. All values outside of this range will be
considered outliers and not tallied in the histogram.
Normalize histogram. See the documentation for the density
parameter of hist for more details.
An array of values w_i weighing each sample (x_i, y_i).
All bins that has count less than cmin or more than cmax will not be
displayed (set to NaN before passing to pcolormesh) and these count
values in the return value count histogram will also be set to nan upon
return.
The bi-dimensional histogram of samples x and y. Values in x are histogrammed along the first dimension and values in y are histogrammed along the second dimension.
The bin edges along the x-axis.
The bin edges along the y-axis.
QuadMeshColormap, default: rcParams["image.cmap"] (default: 'viridis')The Colormap instance or registered colormap name used to map scalar data to colors.
Normalize, optionalThe normalization method used to scale scalar data to the [0, 1] range before mapping to colors using cmap. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
An instance of Normalize or one of its subclasses
(see Colormap normalization).
A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a
list of available scales, call matplotlib.scale.get_scale_names().
In that case, a suitable Normalize subclass is dynamically generated
and instantiated.
When using scalar data and no explicit norm, vmin and vmax define
the data range that the colormap covers. By default, the colormap covers
the complete value range of the supplied data. It is an error to use
vmin/vmax when a norm instance is given (but using a str norm
name together with vmin/vmax is acceptable).
Colorizer or None, default: NoneThe Colorizer object used to map color to data. If None, a Colorizer object is created from a norm and cmap.
0 <= scalar <= 1 or None, optionalThe alpha blending value.
If given, the following parameters also accept a string s, which is
interpreted as data[s] if s is a key in data:
x, y, weights
Additional parameters are passed along to the
pcolormesh method and QuadMesh
constructor.
Notes
Note
This is the pyplot wrapper for axes.Axes.hist2d.
Rendering the histogram with a logarithmic color scale is accomplished
by passing a colors.LogNorm instance to the norm keyword
argument. Likewise, power-law normalization (similar in effect to gamma
correction) can be accomplished with colors.PowerNorm.
Changed in version 3.11: Previously, hist2d would force the axes limits to match the
extents of the histogram; now, autoscaling also takes other plot
elements into account.
matplotlib.pyplot.hist2d#
Copyright 20022012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 20122026 The Matplotlib development team.
Created using Sphinx 9.1.0.
Built from v3.11.2-1-g879ad8ebba.
Built with the PyData Sphinx Theme 0.16.1.
| Web Proxy Viewer | New URL | Original Page |