MATLAB Answers

Overlap two pcolor with different color and set up transparency

조회 수: 49(최근 30일)
Xin
Xin 22 Feb 2017
Commented: Xin 23 Feb 2017
I have two figures like below.
What I want to do is 1) overlap them into one figure. 2) set transparency at the place where they meet each other. The colour can be changed, can be any color where an overlap will look nice.
Many thanks

  댓글 수: 1

Shaibal Ahmed
Shaibal Ahmed 22 Feb 2017
I have a similar question, would be great if someone could answer it.

로그인 to comment.

채택된 답변

Chad Greene
Chad Greene 23 Feb 2017
What about this?
% Some sample data:
[X,Y,Z1] = peaks;
Z2 = flipud(Z1);
% Blue layer:
p1 = surf(X,Y,zeros(size(Z1)),'AlphaData',Z1,...
'FaceAlpha','interp',...
'FaceColor','blue',...
'edgecolor','none');
% Red layer:
hold on
p2 = surf(X,Y,zeros(size(Z2)),'AlphaData',Z2,...
'FaceAlpha','interp',...
'FaceColor','red',...
'edgecolor','none');
view(2)
grid off

  댓글 수: 1

Xin
Xin 23 Feb 2017
Thanks for your reply! Another issue is that the two figure has different colormap, how would you deal with it? Is it possible to put two different colormap together in one figure?

로그인 to comment.

More Answers (0)

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by