Hello Mathematica stackexchange community! I need your help on a research project. I'm looking to create a graph g with vertices in specifies places and then use an image I have as the background of the graph. However I want the vertices to be positioned relative to the image background.
Let me use the code from another question here:
"How to impose custom style to the edges of a graph" asked on Feb.29.1012 by PlatoManiac. Link to the question here: How to impose custom style to the edges of a graph Let's use the graph that he generates:
node = {11, 12, 13, 14, 15, 16};
edges = {11 -> 14, 11 -> 16, 12 -> 16, 12 -> 15, 13 -> 15, 13 -> 16,
14 -> 16, 14 -> 15, 15 -> 16, 15 -> 13, 16 -> 15, 16 -> 14};
vertexposition = {{6.51493919050084`, 44.04756585632944`},
{75.59445680043342`, 50.47455242214042`},
{87.32825501506514`, 13.395648943951699`},
{28.795707353492418`, 3.420138063734413`},
{60.729164933330765`, 16.915777496473908`},
{51.85158892659126`, 25.803692768150313`}};
Show[
Graph[node, edges, VertexCoordinates -> vertexposition,
VertexSize -> {"Scaled", .02},VertexLabels -> "Name"],
Frame -> True, FrameTicks -> True, ImageSize -> 600]
My question is then...
How can I make the background of this graph be the image that I want, the federal district of Brazil (linked to an image of it here:http://www.wolframalpha.com/share/clip?f=d41d8cd98f00b204e9800998ecf8427e53vfptvv3q) However I want to import my own image and not necessarily call it from the wolfram server, just using it now for the example.
But be able to reduce the size of the image such that the vertices change relative to the background image. My first thought for this is that I need to make the vertices be a percentage instead of an exact coordinate. The second part of the question is how can I designate the precise location for certain nodes and not others. For example If I make two nodes (two cities) and they are connected by a water pump in-between the cities as shown here: http://www.wolframalpha.com/share/clip?f=d41d8cd98f00b204e9800998ecf8427eetdfek9rli I only want a fixed coordinate for the two cities (acting as A & C) but don't care where the "B" node (or nodes) ends up lining up (if it changes anything, it will be a directed & weighted graph).
I can't post images yet so I created them in wolfram alpha and put their links.