필터 지우기
필터 지우기

How to do plot in uniform colorization?

조회 수: 2 (최근 30일)
ManKit Tse
ManKit Tse 2012년 7월 26일
Right now, I try to plot multiple 3D plot to show how variable A depends on B and C. I want to plot in different scale, but find the colorization is not in uniform in my figures? is there line of code that I can add that maintain like a value 5 color in red in all figures? Thank you

채택된 답변

Titus Edelhofer
Titus Edelhofer 2012년 7월 26일
Hi,
this is controlled by the CLim property of the axes. So does this example help?
h1 = subplot(1,2,1);
[X,Y,Z]=peaks;
surf(X,Y,2*Z)
colorbar
% store the color limits
cl = get(h1, 'clim');
% do the second plot
h2 = subplot(1,2,2);
surf(X,Y,Z)
colorbar
% and adjust the CLim to the cl from above:
set(h2, 'clim', cl);
Titus
  댓글 수: 2
ManKit Tse
ManKit Tse 2012년 7월 27일
I want to plot in separating plot instead of subplot. Can I still plot in uniform colorization by colorbar?
Titus Edelhofer
Titus Edelhofer 2012년 7월 27일
Yes, you can. Just replace the call to subplot by a call to figure, and write later
cl = get(gca, 'clim');
to retrieve the color limits and
set(gca, 'clim', cl)
to set them for the second plot.

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by