On Tue, 26 Jul 2016, Ben wrote:
> .graphplot() or .show() to do this. However, I'm having trouble displaying
> some kind a legend to go along with the graph to explain which colors are
> which properties.
> I'd like to display with the graph something like
>
> color1 = property A
> color2 = property B
Good question. You can say
G = DiGraph({1:[2,3], 2:[3]})
G.show(vertex_colors={'red': G.sinks(), 'blue': G.sources()}, title="Sinks in red.\nSources in blue.")
but I don't know how to add text to a plot. For example
G = DiGraph({1:[2,3], 2:[3]})
gr = G.plot(vertex_colors={'red': G.sinks(), 'blue': G.sources()})
graphics_array([gr, text("Some colors\nto show special vertices.", (0,0))])
does something that you don't want. I guess that LaTeX (with, say, Tikz)
is needed for production quality pictures. Sage's graphics works for
demonstration in classroom.
--
Jori Mäntysalo