polarscatter — Create scatter charts in polar coordinates.

polarscatter converts angular/radial point data to cartesian scatter coordinates, marks the active axes as polar, and preserves the original ThetaData and RData on returned scatter handles.

Syntax

ps = polarscatter(theta, rho)
ps = polarscatter(theta, rho, sz)
ps = polarscatter(theta, rho, sz, c)
ps = polarscatter(___, mkr)
ps = polarscatter(___, 'filled', Name, Value)
ps = polarscatter(pax, ___)

Inputs

NameTypeRequiredDefaultDescription
thetaNumericArrayYesAngular coordinates in radians.
rhoNumericArrayYesRadial coordinates.
szNumericArrayNo36Marker area in points squared, as scalar, vector, or matrix.
cAnyNoMarker color as color name, RGB triplet, scalar vector, or RGB matrix.
argsAnyVariadicOptional marker, filled flag, axes handle, and name/value properties.

Returns

NameTypeDescription
psAnyScatter handle or row-vector of scatter handles.

Errors

IdentifierWhenMessage
RunMat:polarscatter:InvalidArgumentInput data, size/color/style arguments, or axes targeting are invalid.polarscatter: invalid argument
RunMat:polarscatter:InternalInternal polar scatter construction or rendering fails unexpectedly.polarscatter: internal operation failed

How polarscatter works

  • polarscatter(theta, rho) interprets theta values as radians and requires theta and rho to have compatible element counts.
  • Vector theta with matrix rho, matrix theta with vector rho, and matching theta/rho matrices create one scatter object per matrix column.
  • polarscatter(theta, rho, sz) accepts scalar, vector, or matrix marker-size data. Matrix sizes are sliced by series when theta/rho expands to multiple scatter objects.
  • polarscatter(theta, rho, sz, c) accepts the same positional color forms as scatter, including color names, RGB triplets, scalar color values, and RGB matrices.
  • Marker strings, the filled flag, and common scatter name/value options share the parser used by scatter.
  • The returned value is a scalar scatter handle for one series or a row-vector of scatter handles for multiple series.
  • get(h, 'ThetaData') and get(h, 'RData') return the stored polar source coordinates. Setting either property recomputes the cartesian XData and YData used by the renderer.
  • The target axes are switched to polar mode with equal x/y scaling and symmetric cartesian limits based on the largest radius.

Options

  • Use polarscatter(ax, theta, rho, ...) to target existing axes.
  • Use marker symbols such as 'o', '+', and 'x' after the size/color arguments.
  • Use hold on before additional polarscatter calls to overlay more polar scatter objects on the same axes.
  • Use set(h, ...) on returned handles to update scatter properties after plotting.

Examples

Create a polar scatter chart

theta = linspace(0, 2*pi, 20);
rho = abs(sin(theta));
h = polarscatter(theta, rho);

Expected output:

% h is a scatter handle with ThetaData and RData

Use filled markers with sizes and colors

theta = pi/4:pi/4:2*pi;
rho = [19 6 12 18 16 11 15 15];
sz = 100*[6 15 20 3 15 3 6 40];
c = [1 2 2 2 1 1 2 1];
polarscatter(theta, rho, sz, c, 'filled');

Create multiple scatter series from a matrix

theta = [0 pi/6 pi/2];
rho = [1 2; 2 4; 5 6];
ps = polarscatter(theta, rho, [50 100; 75 125; 100 150]);

Expected output:

% ps is a row-vector with one handle for each rho column

Using polarscatter with coding agents

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

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

FAQ

Does polarscatter keep the original polar data?

Yes. The renderer uses cartesian XData and YData, but the scatter handle also stores ThetaData and RData for MATLAB-style inspection and updates.

Are table-based polarscatter forms supported?

The numeric and axes-targeted plotting forms are supported. Table variable forms depend on the broader table plotting surface and are not treated as complete by this builtin alone.

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.