overlay two surface or mesh plots
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (1)
Voss
el 3 de Jun. de 2022
Editada: Voss
el 3 de Jun. de 2022
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
0 comentarios
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

