pgfhist2d

Creates a 2D histogram from data for use with PGFPLOTS

You are now following this Submission

PGFHIST2D(X, Y, W) will save a PNG file representing the 2D histogram created from data points specified by X and Y with weights specified by W. The vectors X, Y, and W must have the same number of elements. The text to include in a Latex file to produce the histogram is displayed.

Valid options include:
'minX' - the minimum value for X in the histogram (default: min(X))
'minY' - the minimum value for Y in the histogram (default: min(Y))
'maxX' - the maximum value for X in the histogram (default: max(X))
'maxY' - the maximum value for Y in the histogram (default: max(Y))
'binsX' - the number of equally spaced bins for X in the histogram
(default: 100)
'binsY' - the number of equally spaced bins for Y in the histogram
(default: 100)
'filename' - the name of the file for the PNG image
(default: 'test.png')
'logarithmic' - use a logarithmic scale (default: false)

PGFPLOTS is available from:
http://sourceforge.net/projects/pgfplots/
or from CTAN (the Comprehensive TeX Archive Network).

Cite As

Mykel Kochenderfer (2026). pgfhist2d (https://www.mathworks.com/matlabcentral/fileexchange/25325-pgfhist2d), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

Improved speed by using accumarray instead of for loop.

1.0.0.0