changing the scale of marker area size in a scatter plot to show a proportional difference??

2 views (last 30 days)
I am trying to create several scatter plots where my first two variables (X & Y) are cartesian coordinates and S is refers to the size of an object at that location. The several iterations of S vary from 0.7 to 4, obviously this does not show up very clearly on the plot as the markers are too small. I can multiply these numbers by a constant to increase the size, however the difference between them is hard to visualize. I would like to adjust the 'scale' of the marker sizes to the min and max limits of S (0.7:4) so all the markers are clearly visible as is the proportional difference between them. I have also tried to create a legend for marker size, however the script i have creates a legend proportional to the current iterative of S rather than 1 consistent legend that could be used for all plots. Any help would be greatly appreciated. Thanks
cmp = jet(36); %%color bar for time
S = Hs_100;
bubsize = [min(S) quantile(S,[0.25, 0.75]) max(S)];
legentry = cell(size(bubsize));
figure, hold on
for ind = 1:numel(bubsize);
bubleg(ind) = plot(0,0, 'ro','markersize', sqrt(bubsize(ind)),'MarkerFaceColor','red');
set(bubleg(ind),'visible','off')
legentry{ind} = num2str(bubsize(ind));
end
grid on
h = scatter(X,Y,S,cmp,'filled');
legend(legentry)

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!