3D line plot

조회 수: 5 (최근 30일)
Xiu
Xiu 2011년 10월 28일
How to generate a 3D line plot? I know how to generate 3D surface plot using mesh,surf,etc. But instead of surface, i want line plot. for example, I have a set of data, i want to plot the data against time stamp and variables. I tried using plot3, but this function require the inputs to have same dimension. Can anyone help me with this, please?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 10월 28일
If you want to plot 3D lines, you need to have 3D data, whether the data is the typical x,y,z coordinates or one of the dimension is time.
line() can support (x,y,z) pairs.
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2011년 10월 28일
Maybe you need to use meshgrid() to create the vector for m and n
%%
m=7;
n=8;
d=rand(m,n)
[x,y]=meshgrid(1:n,1:m);
plot3(x,y,d);grid on;
Xiu
Xiu 2011년 10월 28일
thank you so much. That is very helpful.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by