필터 지우기
필터 지우기

Apply transparency to an imagesc figure

조회 수: 80 (최근 30일)
Raúl
Raúl 2013년 4월 8일
답변: r.vaghefi 2017년 9월 5일
Hi all,
I would like to apply transparency to a figure generated by imagesc (probably, it does affect).
I've seen that the function 'alpha' does that. I've tried the following line but it gets me and error. The image is I3
Code:
imagesc([0.3 0.75], [0.42 1.1], I3);
Line tried:
alpha(I3,'clear',0.1)
Error:
Error using alpha
Too many input arguments.
Error in Monopulse_Multipathv3 (line 175)
alpha(I3,'clear',0.1)
Could somebody help me?
Thanks in advanced.
Raúl.

채택된 답변

Jan
Jan 2013년 4월 8일
What is "I3"? Dod you read the docs of alpha? You do not find a calling method with 3 inputs there. The error message tells you the same.
  댓글 수: 2
Raúl
Raúl 2013년 4월 8일
I3 is the name of the figure. I've read the doc of alpha but I don't know which arguments to insert or how to do it. I know that the property 'clear' gives you the transparency and the value (in my case 0.1) is the percentage of transparency. I don't know of to write the line.
Thanks.
Raúl
Raúl 2013년 4월 9일
Hi Jan,
Finally I got it. It was easy. The value '0' represents clear, so the command is alpha('0').
Raúl.

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

추가 답변 (1개)

r.vaghefi
r.vaghefi 2017년 9월 5일
You can use the following code:
imagesc([0.3 0.75], [0.42 1.1], 'AlphaData', .1)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by