One figure with two graphics in different colormaps

Hello: I want to create a figure where I can superimpose 2 graphics. The first one is a kind of scalar contour. The second one is a surf bathymetry with a different scale. I can draw the two sets well with the following command, but I can’t make the two different colormaps for each “figure” as I would like (I comment these “desired” ouputs). Thanks in advance.
figure
hSlice=slice(X, Y, Z, S2, x1,[], []);
%set(hSlice,'Colormap','deafult')
%colorbar
%freezeColors
shading interp
hold on
hSurface = surf(X,Y,S1);
%set(hSurface,'Colormap','copper')
shading interp

답변 (2개)

Daniel Shub
Daniel Shub 2013년 5월 31일

0 개 추천

MATLAB figures can only have a single colormap. One option is to define your own color map which concatenates the two desired colormaps and then transform the zscale of your second surface to use the extended colormap. You would then have to define your own colorbar functions...
Image Analyst
Image Analyst 2013년 5월 31일

0 개 추천

Try this: http://www.mathworks.com/support/solutions/en/data/1-GNRWEH/index.html;jsessionid=a8108c3ea8d18c73bd38344fd59e I also have a demo that's a lot better at giving hands on code than that Mathworks solution, though the demo is for images rather than graphics. Let me know if you'd like to see it anyway - it might still be applicable.

카테고리

도움말 센터File Exchange에서 Color and Styling에 대해 자세히 알아보기

질문:

2013년 5월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by