Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Coloring edges by their labels

I'm trying to understand how to use the color_by_label parameter of the Graph.plot() function to set edge colors depending on various conditions. I cannot seem to get any colors to display other than cyan and red, no matter what I put in the edge labels, and, as in the linked image, I cannot seem to reliably get the colors to go with the labels.

In my example, I was trying to set edge color to blue if either of the vertices of an edge is odd, red otherwise.

(Sorry for the external link -- I apparently need to acquire some karma before I can post it here)

Screen Shot of sage notebook session and graphics output

version. Sage 5.0.1 on Mac OS X 10.8.1, notebook running in Chrome

click to hide/show revision 2
retagged

Coloring edges by their labels

I'm trying to understand how to use the color_by_label parameter of the Graph.plot() function to set edge colors depending on various conditions. I cannot seem to get any colors to display other than cyan and red, no matter what I put in the edge labels, and, as in the linked image, I cannot seem to reliably get the colors to go with the labels.

In my example, I was trying to set edge color to blue if either of the vertices of an edge is odd, red otherwise.

(Sorry for the external link -- I apparently need to acquire some karma before I can post it here)

Screen Shot of sage notebook session and graphics output

version. Sage 5.0.1 on Mac OS X 10.8.1, notebook running in Chrome