Open hldwn opened 5 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.
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