Color Plot in MATLAB
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I have a table with accelerometer data in [x,y,z] and then each data point is labelled as either [0,1,2]. The table size is: Rows - 497990 & Column - 4 Column heading (xAcc, yAcc, zAcc, label)
I am trying to plot the only x-axis data vs time. But I want to colour the data based upon the label. So if the label is 0, then it should be red, 1 then green and 2 then blue.
Something like in the image shown.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168866/image.png)
0 commentaires
Réponses (1)
Rik
le 27 Oct 2017
convhull could get you most of the way.
2 commentaires
Rik
le 28 Oct 2017
If you don't need anything real-time, you can simply use logical indexing to split your data. For each portion of your data you can plot it with a different color. And if you want only a hull, convhull will get you that.
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!