Can I plot a digraph on a geomap?

Hey there!
Similar to the question asked here (https://www.mathworks.com/matlabcentral/answers/472642-undirected-graph-network-with-latitude-and-longitude-as-node), I want to know if there is a way I could apply a digraph on geomap.
I couldn't find a way to create nodes with coordinate data (lat & lon), and thus gave arbitary ids (1,2,3...) for the nodes instead. After creating an array of targets (with similar id information), I make an arbitary array of weights and then plot it the graph.
G = digraph(s,t,w,);
plot(G, 'XData',x,'YData',y)
Because the problem is originally a geo problem, my x and y data is in the form of coordinates. However, is there a way to connect this information to GeoAxes so that I can tell Matlab to "accurately" overlay the digraph over the geomap?
A (probably messy) of doing it is to use an image as a background - which (I'm guessing) won't be reliable when reszing the plot.
--
PS: I've read the blog post (https://www.mathworks.com/matlabcentral/answers/472642-undirected-graph-network-with-latitude-and-longitude-as-node), while helpful for sure, Loren uses polygons to create the map of the US, which is overkill for what I want to achieve.
PPS: If you need some more info, please let me know in case I must've missed out anything.

2 comentarios

Michael Wish
Michael Wish el 17 de En. de 2022
I wish someone would answer this! I need the exact same thing!
Christofer Pankratz
Christofer Pankratz el 6 de Sept. de 2023
Editada: Christofer Pankratz el 6 de Sept. de 2023
+1
while it's not an ideal solution, but could work for your purpose as well

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Graph and Network Algorithms en Centro de ayuda y File Exchange.

Productos

Versión

R2020b

Preguntada:

el 11 de Nov. de 2021

Editada:

el 6 de Sept. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by