How to fill the area between two function on a plot with transparent colour?

 채택된 답변

It is. Try, e.g.
d = 0.1;
x = linspace(0,1,20);
z = d*x.^2;
fill([x flip(x)],[z zeros(size(z))],'k','LineStyle','none')
hold on
plot(x,z,'k-');
alpha(0.25)
grid

댓글 수: 2

Thank you Mischa, your answer was very helpful! Then I added the legend, but the colors in the legend were still solid. How could I make them transparent as well? Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

질문:

2015년 4월 21일

편집:

2017년 9월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by