How do I generate a 3D mesh plot in topdown view from my script file?
3 views (last 30 days)
Show older comments
1. I have generated a 3D plot from a mesh. When I run the script the plot is in an isometric view and I have to manually type in view(0,90) to change to topdown. I put this in my script before and after the generation of the plot, figure, etc., but this didn't change it automatically. Does anyone know how to do this? 2. I have tried to normalize the data two ways, by changing the colorbar to (0,1) but this is not correct as the minimum intensity is at about 0.4 not 0.0 and secondly by dividing all values of the grayscale by the maximum value but this makes all values go to one, I think they will not become fractions and hence the image would be valued between 0 and 1 like I want is the reason for this. Thank you. Code below:
% Beam camera
RGBnegthree = imread('z=-3.00.png'); % Import RGB
Inegthree = rgb2gray(RGBnegthree); % Convert to grayscale
%Inegthree = Inegthree./(max(max(Inegthree(:,:)))); % try to normalize
imshow(Inegthree); % show Inegthree
[x,y] = size(Inegthree); % set x and y to size of image
X = 1:x; % run X from 1 to image size
Y = 1:y; % run Y from 1 to image size
[xx,yy] = meshgrid(Y,X); % set xx and yy values as mesh of Y,X
i = im2double(Inegthree); % convert grayscale to double precision
figure; % new figure
mesh(xx,yy,i); % mesh
colorbar; % set colorbar (non normalized)
figure; % new figure
imshow(i); % show i
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!