Extract X,Y,Z data from a MATLAB figure by interacting with a line parallel to X or Y axis.

1 view (last 30 days)
Hi, I have a 3 D plot in MATLAB. I want to cut by planes along X or Y axis and plot the Z values of the cut planes, in order to get the 2 D profiles along that plane. Just like many metrology software, image can be read along X and Y axes for profile heights, I want to do similar task from Matlab figure. In MATLAB figure we have option of cursor data, which can give X,Y,Z points on the figure. But I want to data all the data along a line intersecting the figure. Can anyone help me please?
  1 Comment
Silver
Silver on 14 Nov 2018
Edited: Silver on 14 Nov 2018
Hello ! you may use the function colorbar to color the third parameter and you can use the functioon pcolor or scatter
h1 = pcolor(X,Y,Z); % gives a 2D raster plane
shading flat;
axis image;
colorbar;
or
scatter(X,Y,5,Z,'fill'); % gives a 2D line with X and Y axis and variability of the Z is mentionned by the colorbar
colorbar;
set(gca,'yticklabel',X);
set(gca,'xticklabel',Y)
hope that could help you !

Sign in to comment.

Answers (1)

KSSV
KSSV on 30 Jan 2018
If you have (X,Y) data coordinates in hand, for which you want the respective Z values.......you can do interpolation and get those values....and then you can plot. Have a look on ScatteredInterpolant.

Categories

Find more on Images in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!