New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small bug in Graph.plot() #6615
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
The best way to do that may be to let vertex_colors (resp. edge_colors) in Graph.plot() accept any partition of the vertices ( resp. edges ), and let it deal with rainbow to pick the colors. Obviously, it does not mean Graph.plot() should not also be able to support the current dictionary of (color, list) |
comment:3
All the vertices are colored even if vertex_colors did not contain colors for all of them. The first unused color in ranbow() is taken. There was a small mistake in rgbcolor() where the hexcadecimal values were divided by 256 instead of 255 which lead to "red"!=(1,0,0). All the colors were wrong and nobody noticed !! :-) |
comment:5
|
comment:6
The edge color plot in the description works great. The vertex color plot doesn't. The specified vertex is red; the others disappeared! Also, it would be great to include those two examples in the docs. |
comment:7
Hello Jason !! I sent you an email about this patch some time ago, as I did not understand where this patch failed... Did you get it ? :-) |
Author: Nathann Cohen |
Reviewer: Robert Miller |
comment:8
Patch works fine for me. |
Merged: sage-4.3.rc1 |
comment:10
There are test failures in sage/plot/colors.py |
Attachment: trac_6615-ref.patch.gz depends: sage-4.3.1.alpha1 + #7634 |
Changed merged from sage-4.3.rc1 to sage-4.3.1.alpha2 |
It may take only two lines, but I do not know which ones (I got a bit lost reading graph_plot.py) and it may take half a second to who wrote it in the first place.
g=graphs.PetersenGraph()
g.plot(edge_colors={"red":[(0,1)]})
g.plot(vertex_colors={"red":[1]})
When you plot a graph and want some edges to have a different color, the first plot is perfect. In the second case, though, I think it would be better to assign the others vertices a default color ;-)
Component: graph theory
Author: Nathann Cohen
Reviewer: Robert Miller
Merged: sage-4.3.1.alpha2
Issue created by migration from https://trac.sagemath.org/ticket/6615
The text was updated successfully, but these errors were encountered: