Select to view content in your preferred language

Creating a histogram from a raster?

6129
2
09-30-2017 11:27 AM
JerryDavis
Occasional Contributor

How do you create an actual histogram chart from a raster in ArcGIS Pro? 

  • In Raster Functions under the Imagery tab, there is a Statistics and Histogram function under 'Appearance' but it's not clear how you can make a chart from it.  This appears to create a statistics file, as ArcGIS desktop did, which is necessary to create a histogram.  But there doesn't appear to be functionality anywhere to create a histogram from that statistics file.  
  • The documentation says you can make a chart from any map layer that has an attribute table, but the contextual data tab you would use to get there is only available for feature layers.  I guess the value attribute tables of rasters are not considered attribute tables.
  • One workaround I guess would be to sample the raster by random points and then create a chart from that, but they maybe shouldn't call the raster function 'Statistics and Histograms' unless it actually does something other than create a statistics file.
2 Replies
DanPatterson_Retired
MVP Emeritus

If you are fairly adept with python, you can use the RasterToNumpyArray method in arcpy.da, then use numpy's histogram function to bin the data for making the histogram.  Finally, follow this with MatPlotLib's ability to produce high quality graphs and you are done.  A couple of lines of code and you are off

by Anonymous User
Not applicable

You can now use the Charting capabilities to create histograms of your raster or specific areas of interest of your raster:
Make a chart—Charts | ArcGIS Desktop  

0 Kudos