How to use scatter with transparent dots?

566 views (last 30 days)
facealpha is not working for me

Accepted Answer

Adam Danz
Adam Danz on 9 Oct 2018
Edited: Adam Danz on 14 Jun 2022
MarkerFaceAlpha and MarkerEdgeAlpha are what you're looking for. Check out this example.
[from the link]
x = [5 10 11 13 18];
y1 = [40 80 150 80 50];
a1 = 100*[100 50 80 30 50];
scatter(x,y1,a1,'MarkerFaceColor','b','MarkerEdgeColor','b',...
'MarkerFaceAlpha',.2,'MarkerEdgeAlpha',.2)
axis([0 20 0 200])
x = [2 6 8 11 13];
y2 = [30 40 100 60 140];
a2 = 100*[30 50 30 80 80];
hold on
scatter(x,y2,a2,'MarkerFaceColor','r','MarkerEdgeColor','r',...
'MarkerFaceAlpha',.2,'MarkerEdgeAlpha',.2)
hold off
  5 Comments
Jacek Wodecki
Jacek Wodecki on 17 Aug 2022
markerfacealpha and markeredgealpha is not doing anything, Matlab 2021b. Anyone else?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!