about contour and transparent

조회 수: 1 (최근 30일)
Dawn
Dawn 2011년 6월 11일
편집: John Kelly 2015년 3월 2일
Hi,
I am trying to plot coutour overlaying on the top of imagesc. But my result is contour blocking the imagesc. I tried to make countour transparency.
So, please show me how to make countour transparency.
Thanks.

채택된 답변

Walter Roberson
Walter Roberson 2011년 6월 11일
thick = 0.8; %alpha value
ch = contourf(...);
patches = findobj(ch,'-property','AlphaData')
for ph = patches
set(ph,'AlphaData', thick * get(ph,'AlphaData'));
end
  댓글 수: 2
Dawn
Dawn 2011년 6월 11일
Thank you.
My codes are: two dataset- d ,d1
imagesc(d); % plot figure
hold on;
thick = 0.8; %alpha value
ch =contour(d1,'black'); % overlay a transparent contour over imagesc
patches = findobj(ch,'-property','AlphaData');
for ph = patches
set(ph,'AlphaData', thick * get(ph,'AlphaData'));
end
Aftr running the codes, error message is:
Invalid handle
Error in ==> contourplot at 5
patches = findobj(ch,'-property','AlphaData');
Dawn
Dawn 2011년 6월 11일
Thank you.
My codes are: two dataset- d ,d1
imagesc(d); % plot figure
hold on;
thick = 0.8; %alpha value
ch =contour(d1,'black'); % overlay a transparent contour over imagesc
patches = findobj(ch,'-property','AlphaData');
for ph = patches
set(ph,'AlphaData', thick * get(ph,'AlphaData'));
end
Aftr running the codes, error message is:
Invalid handle
Error in ==> contourplot at 5
patches = findobj(ch,'-property','AlphaData');

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

추가 답변 (1개)

Jaime Calle
Jaime Calle 2011년 7월 4일
편집: John Kelly 2015년 3월 2일
Once you have the handle to contour plot (ch), look for 'FaceAlpha' property in the contour plot children.
Patches = findobj(ch,'-property','FaceAlpha');
Then you can set transparency value to those patches by means of:
set(Patches, 'FaceAlpha', thick)
For patches and surfaces, the object property is 'FaceAlpha':

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by