How to draw lines on a slice graphic?

조회 수: 2 (최근 30일)
Eric Daiber
Eric Daiber 2017년 8월 9일
답변: Star Strider 2017년 8월 9일
Hello all, I am attempting to draw lines on a graphic created by slice. I can get the slice function to work perfectly and the line function (line(x,y,z)) separately but not together. Where K_final is a spatially dependent variable in 3D (x,y,z,K).
Thanks, Eric
hold on % for CP1 x-axis image v = log(K_final); xslice = [75]; %cells yslice = []; zslice = []; h = slice(v,xslice,yslice,zslice); colormap hot; grid off ; xlabel 'x-axis (cells)'; ylabel 'y-axis (cells)'; zlabel 'z-axis (cells)'; set(h,'edgecolor','none'); colorbar; caxis([-9 15]); set(gca, 'view', [270 0]);%looking downgradiant ylim([202 298])
l = [286 286] v = [75 75] g = [1 24] line(l,v,g,'Color', 'k', 'Linestyle', ':','linewidth', 2)

채택된 답변

Star Strider
Star Strider 2017년 8월 9일
For lines in 3D plots, see if the plot3 (link) function will do what you want:
plot3(l,v,g,'Color', 'k', 'Linestyle', ':','linewidth', 2)

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by