Colouring of my Graph

4 vues (au cours des 30 derniers jours)
Georgios Demetriou
Georgios Demetriou le 2 Oct 2021
So I have a graph of my imported messurements, and i would like to colour different parts of it with different colours. Any ideas??
  2 commentaires
Walter Roberson
Walter Roberson le 2 Oct 2021
Do you mean "graph" in the sense of "graph theory" ? Nodes and edges ?
Georgios Demetriou
Georgios Demetriou le 3 Oct 2021
So yeah, my graph is a collection of points.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 3 Oct 2021
If you just have a collection of points in terms of coordinates, and there is no ordering or connections, then use scatter() . The 4th parameter can have one color for every point.
If you have a collection of vertices and edges, then use a graph() object and specify NodeColor when you plot() https://www.mathworks.com/matlabcentral/answers/477504-how-to-choose-different-colors-for-nodes#answer_388996

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by