RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • addpoints
    • ancestor
    • animatedline
    • area
    • axes
    • axis
    • bar
    • barh
    • box
    • caxis
    • cla
    • clf
    • clim
    • colorbar
    • colorcube
    • colormap
    • colororder
    • contour
    • contour3
    • contourf
    • copyobj
    • daspect
    • datacursormode
    • dataTipTextRow
    • errorbar
    • fcontour
    • figure
    • fill
    • fill3
    • findobj
    • fsurf
    • gca
    • gcf
    • get
    • gobjects
    • grid
    • groot
    • heatmap
    • hgload
    • hgsave
    • hidden
    • hist
    • histogram
    • histogram2
    • hold
    • image
    • imagesc
    • imshow
    • legend
    • line
    • linkaxes
    • loglog
    • mesh
    • meshc
    • openfig
    • opengl
    • pan
    • parula
    • patch
    • pie
    • plot
    • plot3
    • plotmatrix
    • plotyy
    • polarhistogram
    • polarplot
    • polarscatter
    • print
    • quiver
    • quiver3
    • ribbon
    • saveas
    • savefig
    • scatter
    • scatter3
    • semilogx
    • semilogy
    • set
    • sgtitle
    • shading
    • sphere
    • stackedplot
    • stairs
    • stem
    • subplot
    • subtitle
    • suptitle
    • surf
    • surfc
    • text
    • textscatter
    • textscatter3
    • title
    • triplot
    • view
    • waitbar
    • wordcloud
    • xlabel
    • xlim
    • xline
    • xscale
    • xtickangle
    • xtickformat
    • xticklabels
    • xticks
    • ylabel
    • ylim
    • yline
    • yscale
    • ytickangle
    • ytickformat
    • yticklabels
    • yticks
    • zlabel
    • zlim
    • zoom

polarhistogram — Create histogram charts in polar coordinates.

polarhistogram(theta) bins angular samples in radians and renders each bin as a polar wedge whose radius is the bin count or normalized bin value. Theta values wrap periodically into the selected angular range. The returned handle reuses MATLAB-style histogram object properties such as BinEdges, BinCounts, Values, Data, NumBins, BinWidth, BinLimits, Normalization, DisplayStyle, FaceColor, FaceAlpha, EdgeColor, and DisplayName.

Syntax

h = polarhistogram(theta)
h = polarhistogram(theta, nbins)
h = polarhistogram(theta, edges)
h = polarhistogram(theta, Name, Value, ...)
h = polarhistogram(pax, ___)
h = polarhistogram('BinEdges', edges, 'BinCounts', counts)

Inputs

NameTypeRequiredDefaultDescription
thetaAnyYes—Angular sample data in radians.
binsAnyYes—Bin count scalar or explicit edge vector in radians.
argsAnyVariadic—Optional axes handle, bin specification, and name/value pairs.
name_valueAnyVariadic—BinEdges/BinCounts pairs and optional style properties.

Returns

NameTypeDescription
hNumericScalarHandle to the created polar histogram chart.

Errors

IdentifierWhenMessage
RunMat:polarhistogram:InvalidArgumentInput data, bin specification, axes targeting, or style arguments are invalid.polarhistogram: invalid argument
RunMat:polarhistogram:InternalInternal polar histogram construction or rendering fails.polarhistogram: internal operation failed

How polarhistogram works

  • All eight integer classes are accepted for angular data; native values gather authoritatively before the explicit floating binning and rendering boundary, while integer bin counts and table selectors remain structural.
  • polarhistogram(theta) creates a histogram object handle and marks the target axes as polar with equal x/y scaling. With no bin controls it uses six angular bins spanning [0, 2*pi].
  • polarhistogram(theta, nbins) and polarhistogram(theta, edges) use the same scalar bin-count and explicit edge-vector semantics as histcounts.
  • Finite theta samples are wrapped into the chosen angular range before binning; non-finite samples are ignored by the histogram counts and exposed as NaN in normalized stored Data.
  • Name/value bin controls such as BinEdges, NumBins, BinWidth, BinLimits, Normalization, and BinMethod are forwarded through the same binning implementation as histogram.
  • polarhistogram('BinEdges', edges, 'BinCounts', counts) creates a polar histogram from precomputed bin counts without sample data.
  • DisplayStyle accepts bar and stairs; stairs renders the outer polar bin arcs without filled radial wedges.
  • Common bar styling arguments such as FaceColor, EdgeColor, LineWidth, BarWidth, FaceAlpha, and DisplayName are accepted.
  • The target axes form polarhistogram(ax, ...) plots into an existing axes handle.
  • The returned handle has type histogram; get exposes histogram state and supported set calls update Normalization, DisplayName, DisplayStyle, FaceColor, FaceAlpha, and EdgeColor.

Examples

Create a polar histogram

theta = 2*pi*rand(1, 1000);
h = polarhistogram(theta);

Expected output:

% h is a histogram object handle

Use explicit angular bin edges

theta = [0 0.2 1.0 2.0];
edges = 0:pi/4:2*pi;
h = polarhistogram(theta, edges);
get(h, 'BinEdges');

Normalize and style the chart

theta = 2*pi*rand(1, 500);
h = polarhistogram(theta, 'NumBins', 16, 'Normalization', 'probability', 'FaceColor', 'red', 'DisplayName', 'angles');
get(h, 'Normalization')

Expected output:

ans =
    'probability'

Plot precomputed polar bin counts with stairs display

edges = [0 pi 2*pi];
counts = [4 2];
h = polarhistogram('BinEdges', edges, 'BinCounts', counts, 'DisplayStyle', 'stairs');
get(h, 'BinCounts');

Using polarhistogram with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how polarhistogram changes the result.

Run a small polarhistogram example, explain the result, then change one input and compare the output.

FAQ

Are theta values interpreted in degrees?⌄

No. Like MATLAB, polarhistogram interprets theta samples and explicit bin edges in radians.

Does polarhistogram return a special handle type?⌄

The returned object follows the histogram handle path, so get(h, 'Type') returns histogram and histogram properties such as BinEdges, BinCounts, Values, Data, NumBins, BinWidth, BinLimits, Normalization, DisplayStyle, and DisplayName are available.

What happens to angles outside 0 to 2*pi?⌄

Finite values are wrapped periodically into the selected angular range before binning. For example, 0, 2*pi, and -2*pi contribute to the same default angular bin.

Can polarhistogram plot GPU arrays?⌄

GPU-resident inputs are accepted through the underlying histogram evaluation path, but the current implementation gathers angular samples for binning before rendering polar wedge geometry. A direct provider binning fast path belongs to the queued GPU audit work.

Related Plotting functions

2D Charts

area · bar · errorbar · heatmap · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem

3D & Surface

contour · contour3 · contourf · mesh · meshc · plot3 · quiver · scatter3 · surf · surfc

Images

image · imagesc · imshow

Axes & Layout

axis · box · grid · sgtitle · subplot · title · view · zlabel

Appearance

colorbar · colormap · legend · shading

Handle Access

gca · gcf · get · set

Other

addpoints · ancestor · animatedline · axes · barh · caxis · cla · clf · clim · colorcube · colororder · copyobj · daspect · datacursormode · dataTipTextRow · fcontour · figure · fill · fill3 · findobj · fsurf · gobjects · groot · hgload · hgsave · hidden · histogram2 · hold · line · linkaxes · openfig · opengl · pan · parula · patch · plotmatrix · plotyy · polarplot · polarscatter · print · quiver3 · ribbon · saveas · savefig · sphere · stackedplot · subtitle · suptitle · text · textscatter · textscatter3 · triplot · waitbar · wordcloud · xlabel · xlim · xline · xscale · xtickangle · xtickformat · xticklabels · xticks · ylabel · ylim · yline · yscale · ytickangle · ytickformat · yticklabels · yticks · zlim · zoom

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how polarhistogram is executed, line by line, in Rust.

  • View the source for polarhistogram in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How polarhistogram works
  • Examples
  • Create a polar histogram
  • Use explicit angular bin edges
  • Normalize and style the chart
  • Plot precomputed polar bin counts with stairs display
  • Using polarhistogram with coding agents
  • FAQ
  • Related Plotting functions
  • 2D Charts
  • 3D & Surface
  • Images
  • Axes & Layout
  • Appearance
  • Handle Access
  • Other
  • Open-source implementation
  • About RunMat