필터 지우기
필터 지우기

How to combine multiple surf plots in one plot with different colormap

조회 수: 5 (최근 30일)
I want to combine three different surf plots, each one with a different colormap, into one plot. I am trying to do something similar to the surf and scatter3 example in the attached figure, but, with surfaces. I am using linkaxes but I am getting a warning: linkaxes requires 2-D axes as input. Use linkprop for generic property linking.
I tried to use linkprop but I couldn't combine the surf plots. I also used hold on and I was able to combine the surfaces but I couldn't have different colormaps. Which command can I use?

채택된 답변

Walter Roberson
Walter Roberson 2017년 6월 26일
In R2014b or later, perhaps the easiest way to do what you want is to create multiple axes in the same location, setting all but one of the axes to 'off' so that it does not draw any axes box or tick marks, and setting the axes background colors to 'none' for all but the bottom one.
The alternative is to create each plot one by one, and to use freezeColors from the File Exchange to turn them from pseudocolor into RGB, so that each becomes independent of following changes in the color map.
I would suggest to you that using different colormaps for different objects in the same scene is likely to be confusing for people. People are going to tend to expect that the meaning of any one color is consistent between the different objects.
  댓글 수: 1
urvashi bothra
urvashi bothra 2021년 9월 3일
Hi Walter,
I have the similar question. I have generated different surface plot in matlab using surf command and now, I want to represent in a single image but with different colours. Using hold on option leads to 1 colourmap and thus, I cannot distinguish the different surfaces.
Can you please elaborate your answer.
Many thanks,
Urvashi

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by