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

Something's wrong with node coloring order ? #153

Closed
mathieu17g opened this issue Jun 12, 2021 · 2 comments
Closed

Something's wrong with node coloring order ? #153

mathieu17g opened this issue Jun 12, 2021 · 2 comments

Comments

@mathieu17g
Copy link

Hello,

When I try to color a graph's nodes with a vector of colors, the index of colors in the nodecolor parameter does not seem to match the node numbers, whereas it works for the nodeshape parameter.

Here is a short example where I try to use colorant"orangered" and :rect shape for node number 9.

using LightGraphs
using Plots
using GraphRecipes

g = SimpleGraph(9)
for i in 1:4; add_edge!(g, i, i+1); end
for i in 5:8; add_edge!(g, i, 9); end
nodecolors = [repeat([colorant"skyblue"], 8); [colorant"orangered"]] # Last node colored in orangered
nodeshapes = [repeat([:hexagon], 8); [:rect]] # Last node with a rectangle shape
graphplot(g, names=1:9, nodecolor=nodecolors, nodeshape=nodeshapes)

wrongly_colored_graphplot

Node number 1 is colored in orangered
Node number 9 has the :rect shape

Am I missing something ?

@mroavi
Copy link

mroavi commented Jun 15, 2021

v0.5.2 does not have this problem.

@mauricelanghinrichs
Copy link

have the same issue on v0.5.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants