3d Surface chat, limit then extent the Z axis

5 次查看(过去 30 天)
Hi all
I am trying to create a 3d surface graph to show the hight of chips on a pcb board. I have all the XYZ values and have got them set as 3 variable and have created a surface chat from that.
using the command: axes equal and now righted the stretching that was occurring, however as my X&Y values are much larger than my Z values the Z axes is now effectively flat(the colour chart shows different colours) but you cant see the variation in height. Id there a way to keep the X&Y as they are (without the stretching distortion) but to increase the Z axis?
Thanks in advance
Sam

回答(1 个)

DGM
DGM 2024-3-26
In lieu of irrelevant AI-generated link spam, consider the example:
% fake xyz data
n = 100;
x = linspace(0,100,n); % x is 100 units wide
y = linspace(0,250,n); % y is 250 units wide
[X Y] = meshgrid(x,y);
Z = zeros(size(X));
Z(25:50,25:50) = 2;
Z(75:90,75:90) = 4; % tallest z feature is only 4 units
% plot it
hs = surf(X,Y,Z);
hs.EdgeAlpha = 0.5;
% set the aspect ratio
% z-features are scaled 10x WRT x or y
% but x and y are 1:1 WRT each other
zsc = 10;
set(gca,'dataaspectratio',[zsc zsc 1])

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by