JuliaGraphs / GraphPlot.jl

Graph visualization for Julia.
http://JuliaGraphs.github.io/GraphPlot.jl/
Other
201 stars 62 forks source link

node coloring failed with over 197 nodes #87

Open hldwn opened 5 years ago

hldwn commented 5 years ago

using LightGraphs, GraphPlot; using Colors;

n = 198 graph = barabasi_albert(n, 3, 3)

mapping = ones(n) mapping[1:100] .= 2

nodecolor = [colorant"green", colorant"red"] nodefillc = nodecolor[convert(Array{Int}, mapping)] gplot(graph, nodefillc=nodefillc)

--> all nodes are black if n<197 --> nodes are green and red

Yuya-Furusawa commented 4 years ago

I have a same problem.

On Jupyter Lab,

using Colors
using LightGraphs
using GraphPlot

node_colors_2 = [colorant"lightseagreen", colorant"orange"]
function plot_graph(n)
    circle = cycle_graph(n)
    actions = fill(2, n)
    nodefillc = node_colors_2[actions]
    gplot(circle, layout=circular_layout, nodefillc=nodefillc)
end

When n=99, the color of all nodes is orage, but when n=100, all nodes are black.

hdavid16 commented 2 years ago

Duplicate of https://github.com/JuliaGraphs/GraphPlot.jl/issues/156