How to use scatter with transparent dots?

582 ビュー (過去 30 日間)
Mr M.
Mr M. 2018 年 10 月 9 日
コメント済み: Benjamin 2024 年 1 月 29 日
facealpha is not working for me
  1 件のコメント
KSSV
KSSV 2018 年 10 月 9 日
Show the code..which you tried.

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2018 年 10 月 9 日
編集済み: Adam Danz 2022 年 6 月 14 日
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 件のコメント
Damon Bradley
Damon Bradley 2023 年 4 月 12 日
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 2024 年 1 月 29 日
@Damon Bradley, thank you! Would have been confused for a long time without this post.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by