MATLAB Answers

Overlap two pcolor with different color and set up transparency

조회 수: 49(최근 30일)
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,...
% Red layer:
hold on
p2 = surf(X,Y,zeros(size(Z2)),'AlphaData',Z2,...
grid off

  댓글 수: 1

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