Is it possible to reduce the alpha for markers in a simple plot?

29 次查看(过去 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

采纳的回答

ANKUR KUMAR
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by