overlay two surface or mesh plots

6 visualizaciones (últimos 30 días)
Frank DelRio
Frank DelRio el 12 de Mzo. de 2019
Editada: Voss el 3 de Jun. de 2022
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

Respuestas (1)

Voss
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

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by