How to put name axes in 3D surf graph

조회 수: 7 (최근 30일)
mohd akmal masud
mohd akmal masud 2023년 1월 16일
편집: Chris 2023년 1월 16일
Dear all,
How to put name of axes in 3D surf graph? Let say I want to put the name x-axes:Gy, y-axes: mm, z-axes: mm
I have the below code
The image data as attached.
clc
clear all
[spect map] = dicomread('I-13125610N1.dcm'); % whatever the name of your image data set
size(spect);
spect = squeeze(spect); %seperately from 4D to 3D (frame)
figure();
surf(sum(spect,3));
title('Sum of All Slices')
colormap(jet());
colorbar();
%the selected slice that you want to plot
figure();
surf(spect(:,:,end)) %"1" indicated the first slice, "end" indicated the las slice
title('First Slice') % title of the graph.
colormap(jet());
colorbar();

채택된 답변

Chris
Chris 2023년 1월 16일
Same way you would with a 2D plot.
xlabel('Gy')
ylabel('mm')
zlabel('mm')
  댓글 수: 2
mohd akmal masud
mohd akmal masud 2023년 1월 16일
not function
Chris
Chris 2023년 1월 16일
편집: Chris 2023년 1월 16일
Why not? It works here:
[x,y,z] = sphere;
figure
surf(x,y,z); axis equal
title('Sphere')
colormap(jet());
colorbar();
xlabel('Gy')
ylabel('mm')
zlabel('mm')
And here's your surface on my machine.
Note, you can make this look a little better by making the edges invisible.
surf(sum(spect,3),'edgecolor','none')

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by