The Tube in Arrow problem is fixed in version 10. Note that in version 10 Graph3D must be used with 3D coordinates.

In Mathematica 9.0.1, when I evaluate

Graph[PolyhedronData["GreatRhombicosidodecahedron", "SkeletonRules"],
  VertexCoordinates -> 
    Thread[Table[i, {i, 1, 120}] -> 
      PolyhedronData["GreatRhombicosidodecahedron", "VertexCoordinates"]]]

No error message was printed, so Quiet is ineffective, yet the output is highlighted in 'error red' and on mouseover it states:

Coordinate index -1 is out of range for the enclosing GraphicsComplex.

However, the coordinates have clearly been implemented in the Graph, so I would like to simply silence this error just as Quiet or Off would for error messages.

I've only encountered this problem in the above context, but suspect the solution is simple. Does anyone know of a solution?

  • 1
    $\begingroup$ I can reproduce your problem, but can't see anything wrong with your code. I suspect a bug in Mathematica's rendering algorithm has surfaced here. Could be wrong because I have little experience with Graph. $\endgroup$
    – m_goldberg
    Commented Apr 4, 2014 at 2:27
  • 2
    $\begingroup$ Replacing Graph with Graph3D and running your command on the Raspberry Pi produces the desired error-free output. I'm sure v10 will be out for the masses any day now. $\endgroup$ Commented May 27, 2014 at 11:54
  • $\begingroup$ @bobthechemist Thanks for letting me know. Excited to not have to bypass the error anymore (not to mention the rest of v10. $\endgroup$
    – Ghersic
    Commented May 28, 2014 at 23:03

2 Answers 2


tl;dr In version 9 Tube inside of Arrow is not handled correctly. This bug is fixed in version 10.

Version 10 and later explicitly supports 3D coordinates for graph vertices, but only when using Graph3D.

I was surprised that Graph supports 3D coordinates at all (!!). Layout algorithms supported in Graph are 2D only.

The problem doesn't seem to be with Graph itself but the Graphics3D object it translates to. Here's a smaller example of the same:

Show@Graph[{1 -> 2}, VertexCoordinates -> {1 -> {0, 0, 0}, 2 -> {1, 0, 0}}]

Show converts it to a Graphics3D object. If you look at the input form, you'll see expressions of the form Arrow[Tube[{1, 2}]] where 1 and 2 stand for 3D coordinates.

This is a valid and documented specification for 3D Arrows and this works fine in Graphics3D:

Graphics3D@Arrow[Tube[{{0, 0, 0}, {1, 0, 0}}]]

But this doesn't seem to work:

Graphics3D@GraphicsComplex[{{0, 0, 0}, {1, 0, 0}}, Arrow[Tube[{1, 2}]]]

It causes the errors you see.

I consider this to be a bug. I'm optimistic it'll be fixed in the next release, but of course it's always a good idea to report bugs you find to support!

Until then, you can use one of two workarounds: either replace Tube with Line, or get rid of Arrow (then you won't see the direction of edges).

If g is your Graph, then just do

Show[g] /. Tube -> Line


Show[g] /. Arrow -> Identity
  • $\begingroup$ Thank you, Szabolcs. The latter (Arrow -> Identity) allows for what visualization I need without resorting to GraphPlot3D (retain styling defaults of Graph, too). Glad to possibly have found a bug and to have prompted an answer from you. Will wait little bit for good measure, then accept an answer. $\endgroup$
    – Ghersic
    Commented Apr 4, 2014 at 2:56

Wrong use of Graph in this case I believe. I think the following does what you're after:

Graphics3D[{FaceForm[], EdgeForm[Blue], 
  PolyhedronData["GreatRhombicosidodecahedron", "Faces"], 
  PointSize[Large], Red, 
  Point /@ PolyhedronData["GreatRhombicosidodecahedron", 
    "VertexCoordinates"]}, Boxed -> False]

enter image description here

  • 1
    $\begingroup$ Just as a clarification to my answer: I completely agree that to plot this in 3D, your solution should be used. It looks like 3D vertex coordinates are not documented so probably not supported in v9 ... when I said I believe this is a bug I was referring to the fact that Arrow[Tube[...]] doesn't work inside GraphicsComplex. That's a graphics bug, not a graph one. $\endgroup$
    – Szabolcs
    Commented Apr 5, 2014 at 17:53
  • $\begingroup$ @Szabolcs: No need to clarify, but appreciated. Yes, the whole ability to even get a 3D result for a graph is I think a side-effect of Graph using the underlying graphics primitives, and the vertex info gets passed along. Neat that it works, but who knows what will or won't work for undocumented features / effects in the future. $\endgroup$
    – ciao
    Commented Apr 5, 2014 at 22:32
  • $\begingroup$ We'll have Graph3D in the future for this :-) $\endgroup$
    – Szabolcs
    Commented Apr 6, 2014 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.