Effacer les filtres
Effacer les filtres

Add arrows to a graph

2 vues (au cours des 30 derniers jours)
JMS
JMS le 7 Avr 2014
Commenté : Joseph Cheng le 7 Avr 2014
Hi,
Can anyone please tell how can I add arrows to a graph like the attached image

Réponses (2)

Mischa Kim
Mischa Kim le 7 Avr 2014
Modifié(e) : Mischa Kim le 7 Avr 2014
JMS, if you are talking about the vector field, use quiver. For labeling the graph you add lines (manually or in the code) and edit the properties to add arrows.
  1 commentaire
JMS
JMS le 7 Avr 2014
Hi Mischa Kim, Thanks for your reply. Firstly, I should asked how to get the first image without Arrows and then for the second one how? Do you know how I can color the vector field like the first image"Without arrows"? Then we can talk about the second one.
Many thanks!

Connectez-vous pour commenter.


Joseph Cheng
Joseph Cheng le 7 Avr 2014
so to get the image without the arrows i am going to assume you have the [x,y,u,v] that will be used in quiver. as you have x,y,u, and v coordinates you can calculate the magnitude of the vector for each x,y position using u and v. then use imagesc(x,y,m) where m is the magnitude of each vector.
  1 commentaire
Joseph Cheng
Joseph Cheng le 7 Avr 2014
The link above should contain all the information you need about annotating graphs in matlab.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by