Clear Filters
Clear Filters

Can I plot a digraph on a geomap?

9 views (last 30 days)
Trevor John D Silva
Trevor John D Silva on 11 Nov 2021
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
Michael Wish
Michael Wish on 17 Jan 2022
I wish someone would answer this! I need the exact same thing!
Christofer Pankratz
Christofer Pankratz on 6 Sep 2023
Edited: Christofer Pankratz on 6 Sep 2023
+1
while it's not an ideal solution, but could work for your purpose as well

Sign in to comment.

Answers (0)

Categories

Find more on Geographic Plots in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!