File Exchange

## CDOT - Creating circular dot plots

version 1.0.0.0 (3.4 KB) by
Plot angular data in a circular dot histogram

Updated 23 Jun 2016

Circular can be plotted using Matlab's inbuilt rose function, but the resulting plots are not very pretty (and also overrepresent large values). Instead, this function plots data as circular dot plots.
Three functions are included: cdot_plot is the main function, which calculates the histogram and then calls cdot_hist to create the plot. The third function, cdot_label, can be used to add ticks and labels to the plot. Both cdot_plot and cdot_hist take a number of optional inputs to modify the appearance of the plot (see examples below or comments in the functions), and give the option to append dot plots to an existing graph. This latter option allows the user to plot two datasets into one graph with different dot colours.
Examples:
0) Create some random example data.
angles1 = randn(30, 1)*90+180;
angles2 = randn(30, 1)*90+180;

1) Plot data using defaults, and label it:
figure;
r = cdot_plot(angles1); % the output variable r defines the outer radius of the dotplot
cdot_label(0:30:330, r); % if r is not provided, the function will make a guess based on the largest rectangle object

2) Plot data with custom colours, and label with compass directions
figure;
r = cdot_plot(angles1, 5, 'k', 100, 7);
cdot_label(0:45:315, r, [], [], [], [], {'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'});

3) Plot both data sets in different colours, then label
cdot_plot(angles1, 5, 'b', 100, 7);
cdot_plot(angles2, 5, 'r', 100, 7, [], '-a');
cdot_label(0:90:270);

### Cite As

Jochen Smolka (2020). CDOT - Creating circular dot plots (https://www.mathworks.com/matlabcentral/fileexchange/57827-cdot-creating-circular-dot-plots), MATLAB Central File Exchange. Retrieved .

David Wilby

Hej Jochen! Thanks for the functions!

john clark