Graphing an array so the largest row graphs first and then so forth
Afficher commentaires plus anciens
I have an x and y array, let's say the x-array is: (1,8,15,NaN,NaN; 1,8,15,22,29; 1,8,15,22,NaN), and the y-array is: (0,0,0,NaN,NaN; 0,0,0,2,2; 0,0,0,0,NaN). I would like to graph these two arrays so that the row vector with the longest length is graphed first, and then so on and so on. This is because when I am graphing these arrays right now, the first y-vector gets 'overwritten' by the next two y-vectors and I can't see the line at all. How do I fix this?
1 commentaire
Gabriel
le 26 Avr 2023
Réponse acceptée
Plus de réponses (1)
IMHO, it's better just to assign distinct markers:
x=[1,8,15,NaN,NaN; 1,8,15,22,29; 1,8,15,22,NaN];
y=[0,0,0,NaN,NaN; 0,0,0,2,2; 0,0,0,0,NaN];
H=plot(x',y'); axis padded
[H.MarkerSize]=deal(6,10,14);
[H.Marker]=deal('x','s','o');
Catégories
En savoir plus sur Graph and Network Algorithms 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!

