Short story:
I want to plot graphs on top of a map. Can I use GMT.jl to draw the region of interest and plot over it using GraphMakie.jl ?
Long story:
GraphMakie.jl
Let’s say I want to plot the Abilene network.
I have my coordinates data taken from the SNDlib (longtitude, latitude):
Dict{Tuple{Float64, Float64}, String} with 12 entries:
(-96.5967, 38.9617) => "KSCYng"
(-122.3, 47.6) => "STTLng"
(-105.0, 40.75) => "DNVRng"
(-122.026, 37.3858) => "SNVAng"
(-87.6167, 41.8333) => "CHINng"
(-85.5, 34.5) => "ATLAng"
(-77.0268, 38.8973) => "WASHng"
(-73.9667, 40.7833) => "NYCMng"
(-86.1595, 39.7806) => "IPLSng"
(-95.5174, 29.77) => "HSTNng"
(-118.25, 34.05) => "LOSAng"
(-84.3833, 33.75) => "ATLAM5"
Using a simple layout function I can get a realistic graph visualization:
GraphMakie.graphplot(gr; layout=mycoordlayout)
But I would like to have as a background the USA map.
GMT.jl
Inspired from the code here Map projections · GMT, I do:
using GMT
coast(region=[-130 -70 24 52], proj=(name=:lambertConic, center=[-100 35], parallels=[33 45]),
frame=:ag, borders=((type=1, pen=("thin","red")), (type=2, pen=("thinner",))),
land=:tan, water=:darkblue)
scatter!(coordslong, coordslat, markersize=0.2, mc=:darkgreen, show=true)
So the scatter does overwrite the image and I get my nodes at the right coordinations.
I guess I can continue going and create the edges between the nodes as lines, but I am hoping for a better solution.
Desirable
I would like to be able to do something like:
GMT.coast(region=[-130 -70 24 52], proj=(name=:lambertConic, center=[-100 35], parallels=[33 45]),
frame=:ag, borders=((type=1, pen=("thin","red")), (type=2, pen=("thinner",))),
land=:tan, water=:darkblue)
GraphMakie.graphplot!(gr; layout=mycoordlayout)
and get my graph on top of the map.
I gues that means (correct me if I am wrong) combing 2 different plotting backends on the same plot; would that be possible ?