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 Comments

I wish someone would answer this! I need the exact same thing!
+1
while it's not an ideal solution, but could work for your purpose as well

Sign in to comment.

Answers (0)

Products

Release

R2020b

Asked:

on 11 Nov 2021

Community Treasure Hunt

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

Start Hunting!