I am trying to use Graph
(not GraphPlot
) and replace some of the vertices with an image, like so:
Graph[
graph,
EdgeWeight -> edges,
EdgeLabels -> "EdgeWeight",
VertexLabels -> "Name",
VertexShapeFunction -> {_?(KeyExistsQ[sprites, #] &) ->
SpriteVertexFunction}
]
I define SpriteVertexFunctions
without really using any of the callback parameters:
SpriteVertexFunction[{xc_, yc_}, name_, {w_, h_}] := sprites[name];
And sprites
is an Association
of numbers to imported images, which I've tried Rasterize
ing too:
The error I'm getting is
Graphics is not a Graphics primitive or directive.
Can Graph
not draw verticies with arbitrary images? Do I have to use GraphPlot
instead?
Inset[]
withVertexShapeFunction
. $\endgroup$