That is great. Now, is there someway to permanently associate those two 
parameters to the graph? i.e., G.show() has the colors and title?


On Wednesday, July 27, 2016 at 2:43:17 AM UTC-4, jori.ma...@uta.fi wrote:
>
> 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 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to