Matlab 2D line plot?

조회 수: 1 (최근 30일)
Rubel Ahmed
Rubel Ahmed 2021년 6월 21일
댓글: Rubel Ahmed 2021년 6월 21일
Hi all,
I am plotting a 2D plot using command
plot(X,Y,'-mo',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',4)
Where X and Y are the array of discreate points. The line joining top point A to point M is expected .later the line from M go directly on point Y depending on the Y height I guess, but I dont want this . I want to see the joining line as A.....G... M-N-O-P-Q.....Y..... as a sequence.
Thanks in advance.
  댓글 수: 3
KSSV
KSSV 2021년 6월 21일
Reubel Ahmed commented:
These data point is not constant and not consistent as a different programm generate the data with different time step.
KSSV
KSSV 2021년 6월 21일
You need to arrange the data accordinglly to get your plot.

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

답변 (1개)

Walter Roberson
Walter Roberson 2021년 6월 21일
[SX, idx] = sort(X);
SY = Y(idx);
plot(SX, SY,'-mo',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',4)
  댓글 수: 1
Rubel Ahmed
Rubel Ahmed 2021년 6월 21일
Thanks but the outcome not expected,plz find the image

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

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by