overlay two surface or mesh plots

9 ビュー (過去 30 日間)
Frank DelRio
Frank DelRio 2019 年 3 月 12 日
編集済み: Voss 2022 年 6 月 3 日
Hi everyone,
I would like to overlay two surface or mesh plots, both of which are attached here. The first mesh plot (black and white) represents the topography of a surface, and the second mesh plot (red and white) represents the local curvature of the surface.
Basically, I would like to overlay the curvature data onto the topography data, but with the transparency of the curvature data varying from transparent for the white regions to opaque for the red regions (such that only the red data appears on the black and white mesh plot).
If varying the transparency of the curvature data is too difficult, another option would be to define a threshold value for curvature, and then overlay anything above that threshold onto the topography data. Thanks in advance for the help!
Frank

回答 (1 件)

Voss
Voss 2022 年 6 月 3 日
編集済み: Voss 2022 年 6 月 3 日
topography = imread('topography.jpg');
curvature = imread('curvature.jpg');
% attempting to crop axes and labels from images.
% you can omit this if you start with the actual
% image data, rather than images of MATLAB figures.
topography = topography(70:640,125:790,:);
curvature = curvature(70:640,125:790,:);
% initial images, for reference
figure()
subplot(1,2,1)
imshow(topography)
subplot(1,2,2)
imshow(curvature)
% overlaid images
figure()
im_topography = image('CData',topography);
hold on
red_val = double(curvature(:,:,1));
min_red_val = min(red_val(:));
max_red_val = max(red_val(:));
transparency = (red_val-min_red_val)/(max_red_val-min_red_val);
im_curvature = image('CData',curvature,'AlphaData',1-transparency);
set(gca(),'YDir','reverse')
axis off

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by