Closed Jacob-Stevens-Haas closed 6 years ago
I'm unable to reproduce (your code with n=300
):
Thanks for the quick reply. How interesting. Are you using something other than the Colors
package? I added it to the previous post. Here's the images I'm getting, FYI:
n=150
n=300
Interestingly, when I use the other example from the documentation:
nodefillc = distinguishable_colors((g), colorant"blue")
it seems to work:
In both cases,
typeof(nodefillc)
returns Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},1}
. They're both length 300.
Edit: I'm using Jupyter notebooks. Judging by the background, you're using Juno? Let me try that.
Are you using something other than the Colors package?
Not that I'm aware.
I was doing this within vscode, so maybe that makes a difference?
Struggling to get plots working in Juno. Can GraphPlot work as a backend to Plots.jl? I see your examples on other issues reference Compose.jl, rather than Plots.jl
EDIT: I was able to get draw(SVG("testplot2.svg", 8cm, 8cm), gplot(g, nodefillc=nodefillc))
to work.
Opening the file, I see that the vertices are colored correctly. (still could use help displaying in the plots window in Juno or as a gui in the REPL)
That being said, this issue clearly applies to the Jupyter/IJulia+GraphPlot combination. I'll update the title accordingly. Not sure exactly how gplot()
works, so I don't know if it's a problem with large Compose objects, specifically with gplot
, or with IJulia.
I'm relatively new to GraphPlot, so I'll try other node and edge parameters to see if they also break with large graphs
Since this isn't specific to gplot, I think we can close this out. It's more likely some bug in jupyter/ijulia or some strange edge case. Let me know if you'd like to continue troubleshooting and I'm happy to reopen.
Can still reproduce. Also unsure where the cause is. I've a new clue though. Currently I'm rendering to file as a workaround, but I've noticed that if I render the same plot object (the return value of gplot(...)
call) more than once, after the first time the nodes will be colored black. Using JupyterLab.
My snippet:
p = gplot(sg, nodefillc=nodefillc);
draw(SVG("plot.svg", 50cm, 50cm), p);
I'm looking at a version of the connectome("neural wiring") of the C. elegans worm, a graph of 297 vertices. I'm trying to display the graph with each vertex colored according to it's eccentricity, with more central vertices in a hotter color.
However,
gplot()
colors each node black, even with thenodefillc
parameter assigned. It seems that this is an issue with plotting large graphs. Test code, adapted from the documentation:When
n
is larger than 195, the nodes are all filled in black, as opposed to green and orange.