One figure with two graphics in different colormaps

7 ビュー (過去 30 日間)
Miguel Ángel
Miguel Ángel 2013 年 5 月 31 日
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 日
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 日
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.

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by