필터 지우기
필터 지우기

How to draw a horizontal line in a diagram (3D plot)?

조회 수: 12 (최근 30일)
Philipp Mueller
Philipp Mueller 2016년 10월 21일
편집: Adam 2016년 10월 21일
Hello,
I want to draw a horizontal line in my diagram! But it does not work. (Its a 3d plot with the view from above) Thank you for your support. Coordinates: x1=-350, y1=60, z1=10^6; x2=-100, y2=60, z2=10^6
Input_Matrix = textread('Input1.txt')
[zeilen,spalten]=size(Input_Matrix)
x = Input_Matrix(:,1)
y = Input_Matrix(:,2)
z = Input_Matrix(:,3)
colorbar('location','Manual', 'position', [0.93 0.1 0.02 0.81]);
%WHY IT DOES NOT WORK?
%plot([-350,60,1000000],[-100,60,1000000])
%line([-350 60 1000000], [-100 60 1000000],'Color','r','LineWidth',19)
az = 0;
el = 90;
view(az, el);
view(0,90)
a = 30;
scatter3(x, y, z, a, z, 'filled');
hold on
view(0, 90)
[m,ind]=max(z);
scatter3(x(ind), y(ind), z(ind),'*r');
colorbar
datacursormode on
  댓글 수: 1
Adam
Adam 2016년 10월 21일
편집: Adam 2016년 10월 21일
plot([-350,60,1000000],[-100,60,1000000])
works fine for me, when run on its own.

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

채택된 답변

Mischa Kim
Mischa Kim 2016년 10월 21일
Philipp, use the line command.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by