I’m working om a dataset with 4000+ Vertices and wanted to make some of the Vertices a bit larger.
After spending a lot of time I found some suggestions like here:
But it seems that the VertexSize is limited to a maximum of 1000 Vertices.
I couldn’t find any documentation to such a limit and I would really think it’s a pity to find this is bug.
So perhaps there’s a workaround.
(The code is clumsy but I found it to be the most predictable)
> h = RandomGraph[{999, 800}, ImageSize -> {800, 800}]
Hi Scabolcs, Where did you use the VertexShapeFunction. When I use it I get errors (Unknown box name with Graph Elements [Circle]) or it doesn’t change anything.
When I use
I did not actually download your notebook. I just tested what happens with more than 999 vertices.
Now I tried your notebook and I believe there is (yet another!) bug in Mathematica’s graph functionality. That is why you get the pink boxes. You should report this to Wolfram Support (please do).
VertexShapeFunction -> "Circle" should be used in Graph, as you have. This code works:
The default size seems to be too small for the vertices to be visible.
As a workaround for your case, you can use VertexShapeFunction -> (Disk[#1,#3]&).
This sort of styling will be much easier to do in the next version of the IGraph/M package, by chaining IGVertexMap functions. I plan to release a preview version on the weekend that you can play with. Until then, here’s a teaser:
I only saw your post after I posted mine
Looks great! Will definitely play with the package and will post my results.
What I also see is that when I use the VertexSize → x with property[] it will show the Circle or Square etc on top of the Graph.
This causes large VertexSizes to overlap with smaller vertices when they are close. I haven’t found an option yet to get the edges in sync with the space reserved for the VertexSize. When I look at your picture I also see that overlap. It seems that when you use
Graph[…,VertexSize->x,…] it uses the x size for the rendering of the complete Graphs and afterwards it will put the Vertexes specifically defined with VertexSize on top of the space x. Thx for your help. Much appreciated!
Actually, this may not be a bug. VertexSize -> Scaled[s] is not a documented syntax. It does happen to work in some cases, but that is just a coincidence. The correct usage is VertexSize -> {"Scaled", s}.
The sizes passed to the vertex function are expected to be a pair of numbers, not a Scaled form. The VertexSize -> {"Scaled", s} specification still allows for scaled sizes, but translates these to plain numbers before passing them to the vertex shape function.
Another comment: with either VertexShapeFunction -> "Circle" or VertexShapeFunction -> (Disk[#1, #3]&), you may want to add EdgeForm[Black] to the vertex style.