How to make the color of the filled part transparent

14 ビュー (過去 30 日間)
高祥 袁
高祥 袁 2021 年 11 月 21 日
編集済み: the cyclist 2021 年 11 月 21 日
figure
ax1 = axes;
ax2 = axes;
x=linspace(1,10,10);
y=sin(x);
plot(ax2,x,y,'Marker','o','MarkerSize',10,'MarkerFaceColor','y')
fill(x,y,'r')
I = imread('peppers.png');
imshow(I,'Parent',ax1) % Show the image on ax1
ax2.Color='none';
How to make the color of the filled part transparent so that I can see the full picture

採用された回答

the cyclist
the cyclist 2021 年 11 月 21 日
編集済み: the cyclist 2021 年 11 月 21 日
Use the FaceAlpha property, with a value near zero:
figure
ax1 = axes;
ax2 = axes;
x=linspace(1,10,10);
y=sin(x);
plot(ax2,x,y,'Marker','o','MarkerSize',10,'MarkerFaceColor','y')
fill(x,y,'r','FaceAlpha',0.2)% <------- SEE THE DIFFERENCE HERE
I = imread('peppers.png');
imshow(I,'Parent',ax1) % Show the image on ax1
ax2.Color='none';
  1 件のコメント
高祥 袁
高祥 袁 2021 年 11 月 21 日
thank you so much

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

その他の回答 (0 件)

カテゴリ

Find more on Lighting, Transparency, and Shading in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by