How to use scatter with transparent dots?

458 vues (au cours des 30 derniers jours)
Mr M.
Mr M. le 9 Oct 2018
Commenté : Benjamin le 29 Jan 2024
facealpha is not working for me
  1 commentaire
KSSV
KSSV le 9 Oct 2018
Show the code..which you tried.

Connectez-vous pour commenter.

Réponse acceptée

Adam Danz
Adam Danz le 9 Oct 2018
Modifié(e) : Adam Danz le 14 Juin 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
  7 commentaires
Damon Bradley
Damon Bradley le 12 Avr 2023
Depends on the marker you use. If you use a dot '.', you will not see any result. With other markers, you will. I've done this on R2020a though, so please double-check with your rev. Good luck!
Benjamin
Benjamin le 29 Jan 2024
@Damon Bradley, thank you! Would have been confused for a long time without this post.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by