Variable marker size scatter plot
39 views (last 30 days)
Show older comments
Xavier Simón Montero
on 5 Dec 2022
Commented: Xavier Simón Montero
on 7 Dec 2022
I am trying to create an scatter plot as shown below from a regular scatter plot.

The objetive is that the size of the marker corresponding to a certain area becomes dependant of the number of points in that area.
Does anybody know how to do this?
0 Comments
Accepted Answer
Steven Lord
on 5 Dec 2022
The size input argument to the scatter function can be a scalar or an array of the same size as the coordinate data. In the example below the marker at coordinates (10, 100) is much larger than the marker at coordinates (1, 1).
x = 1:10;
y = x.^2;
scatter(x, y, 2*y)
More Answers (0)
See Also
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!