MATLAB Examples

This is an example of how to create a polar scatter plot in MATLAB®.

Read about the polarscatter function in the MATLAB documentation. This function is available in R2016b or newer.

For more examples, go to MATLAB Plot Gallery

% Check version
if verLessThan('matlab','9.1')
    error('polarscatter is available in R2016b or newer.')
end

% Load position, magnitude, color information of stars
load stars.mat

% Create polar scatter plot using the polarscatter function
polarscatter(RightAscension, Declination, Magnitude, StarColor, 'filled')

% Change colormap
colormap(star_colormap)

% Change axes color
set(gca, 'Color', [0.7 0.7 0.7])