Skip to content
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

Closed
nathanncohen mannequin opened this issue Jul 24, 2009 · 13 comments
Closed

Small bug in Graph.plot() #6615

nathanncohen mannequin opened this issue Jul 24, 2009 · 13 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jul 24, 2009

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

@nathanncohen

This comment has been minimized.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Aug 2, 2009

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)

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Aug 14, 2009

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 !! :-)

@nathanncohen nathanncohen mannequin added this to the sage-4.1.2 milestone Aug 14, 2009
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Aug 24, 2009

comment:5
  • Graphfunctions-1 has no reason for being here, but I can not delete it
    • patchplot has been updated, I had forgotten to commit the change from 256 to 255 in rgbcolor()

@jasongrout
Copy link
Member

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.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Oct 27, 2009

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 ? :-)

@rlmill
Copy link
Mannequin

rlmill mannequin commented Dec 16, 2009

Author: Nathann Cohen

@rlmill
Copy link
Mannequin

rlmill mannequin commented Dec 16, 2009

Reviewer: Robert Miller

@rlmill
Copy link
Mannequin

rlmill mannequin commented Dec 16, 2009

comment:8

Patch works fine for me.

@rlmill rlmill mannequin added s: needs review and removed s: needs work labels Dec 16, 2009
@mwhansen
Copy link
Contributor

Merged: sage-4.3.rc1

@mwhansen
Copy link
Contributor

comment:10

There are test failures in sage/plot/colors.py

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jan 6, 2010

Attachment: trac_6615-ref.patch.gz

depends: sage-4.3.1.alpha1 + #7634

@rlmill rlmill mannequin added s: needs review and removed s: needs work labels Jan 6, 2010
@rlmill rlmill mannequin added s: positive review and removed s: needs review labels Jan 6, 2010
@rlmill
Copy link
Mannequin

rlmill mannequin commented Jan 13, 2010

Changed merged from sage-4.3.rc1 to sage-4.3.1.alpha2

@rlmill rlmill mannequin removed the s: positive review label Jan 13, 2010
@rlmill rlmill mannequin closed this as completed Jan 13, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants