ui.Chart.image.histogram

Generates a Chart from an image. Computes and plots histograms of the values of the bands in the specified region of the image.

  - X-axis: Histogram buckets (of band value).

  - Y-axis: Frequency (number of pixels with a band value in the bucket).

Returns a chart.

UsageReturns
ui.Chart.image.histogram(image, region, scale, maxBuckets, minBucketWidth, maxRaw, maxPixels)ui.Chart
ArgumentTypeDetails
imageImage

The image to generate a histogram from.

regionFeature|FeatureCollection|Geometry, optional

The region to reduce. If omitted, uses the entire image.

scaleNumber, optional

The pixel scale used when applying the histogram reducer, in meters.

maxBucketsNumber, optional

The maximum number of buckets to use when building a histogram; will be rounded up to a power of 2.

minBucketWidthNumber, optional

The minimum histogram bucket width, or null to allow any power of 2.

maxRawNumber, optional

The number of values to accumulate before building the initial histogram.

maxPixelsNumber, optional

If specified, overrides the maximum number of pixels allowed in the histogram reduction. Defaults to 1e6.

Examples

JavaScript

// Your example goes here!

Python

# Your example goes here!