Is it possible to reduce the alpha for markers in a simple plot?
19 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I am having a simple plot like
plot(X,Y, 'MarkerFaceColor','#0072BD')
Is it possible to reduce the transparency of MarkerFaceColor to 0.5?
Thanks in advance
0 件のコメント
採用された回答
ANKUR KUMAR
2021 年 3 月 12 日
編集済み: ANKUR KUMAR
2021 年 3 月 12 日
Plot function doesn't have support to tune transparency. You can use scatter to do that
scat = scatter(x,y,'MarkerFaceColor','b','MarkerEdgeColor','r');
scat.MarkerFaceAlpha = .5;
scat.MarkerEdgeAlpha = .5;
You can manipulate the color values, if you wish to use plot function.
hand = plot(X,Y,'r');
hand.LineWidth = 2;
hand.Color(4)=0.2; % this would act as your alpha value or transparency factor.
2 件のコメント
ANKUR KUMAR
2021 年 3 月 15 日
First three indices are for RGB color, and the fourth index is the transparency.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!