File Exchange

image thumbnail


version 1.0.2 (28.2 KB) by Frederick Zittrell
Bivariate histogram plot from polar coordinates / position vectors in MATLAB.


Updated 08 May 2019

From GitHub

View Version History

View license on GitHub

Bivariate histogram plot from polar coordinates / position vectors.
Esentially, the coordinates are converted to cartesian coordinates and fed to
HISTOGRAM2. A polar-coordinate grid is then drawn in order to mimic a polar plot.
The properties and methods of this class are intended to mimic a polar plot like it
is created by POLARAXES and properties with the same name, such as 'ThetaDir', mimic
the behavior of a real POLARAXES. Note that this has limitations and might not work
flawlessly. Properties may be specified via Name-Value pairs during plot
construction or set post-hoc using dot-notation or set(obj, param, val). HISTOGRAM2
is called with the parameters {'DisplayStyle', 'tile', 'ShowEmptyBins', 'off',
'EdgeColor', 'none'}, which can be overridden by specifying the respective
Name-Value pairs during plot creation or by accessing the returned object's property
'Histogram'. Optional Name-Value pairs of this function support those specified
below and all Name-Value pairs as accepted by HISTOGRAM2.


histogram2Polar(theta, rho);
histogram2Polar(theta, rho, binWidth);
histogram2Polar(theta, rho, binWidth, Name, Value);
histogram2Polar(target, ___);
h = histogram2Polar(___);

[...] (See documentation and GitHub repository)

Cite As

Frederick Zittrell (2021). histogram2Polar (, GitHub. Retrieved .

Comments and Ratings (2)


Adam Danz

Clean and well-documented function. There are some limitations to mimicking polar axes in Cartesian coordinates similar to Matlab's outdated polar function but your approach to using histogram2 is quite clever.

MATLAB Release Compatibility
Created with R2019a
Compatible with R2017a and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!