Matlab 2D line plot?
Afficher commentaires plus anciens
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 commentaires
KSSV
le 21 Juin 2021
Attach your data points.
KSSV
le 21 Juin 2021
Reubel Ahmed commented:
These data point is not constant and not consistent as a different programm generate the data with different time step.
KSSV
le 21 Juin 2021
You need to arrange the data accordinglly to get your plot.
Réponses (1)
Walter Roberson
le 21 Juin 2021
[SX, idx] = sort(X);
SY = Y(idx);
plot(SX, SY,'-mo',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',4)
1 commentaire
Rubel Ahmed
le 21 Juin 2021
Catégories
En savoir plus sur Line Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
