For 2D graphics, there exists the function FullGraphics to turn the stuff Mathematica generates automatically on Graphics (like axes) into explicit graphics primitives. However that function doesn't work on Graphics3D objects. So is there some (possibly undocumented) function which does the same for 3 dimensional graphics?

  • 1
    $\begingroup$ I don't know, but I don't believe so. The reason is that 2D and 3D can be mixed: Graphics3D[Sphere[], Epilog -> {Circle[]}]. $\endgroup$
    – Szabolcs
    Commented Jan 30, 2012 at 18:17
  • 1
    $\begingroup$ I've had this question since version three, actually... $\endgroup$ Commented Jan 30, 2012 at 18:29
  • $\begingroup$ @J.M. I think something was possible in v5 to project down 3D polygons to a Graphics[] and get a nice figure, but I'm not sure ... $\endgroup$
    – Szabolcs
    Commented Jan 30, 2012 at 18:44
  • 1
    $\begingroup$ Oh, I'm aware of Shadow[], @Szabolcs; what I have been wondering is how does one get the ticks and boxes from a Graphics3D[] object. Among other things... $\endgroup$ Commented Jan 30, 2012 at 18:49
  • 7
    $\begingroup$ One of the complications with Graphics3D is that the axes can move to different edges when rotating the bounding box. And even when you fix AxesEdge, the tick marks will be projected on different sides of the bounding box depending on the orientation of the figure. You would lose that effect when you replace the axes and tick marks with lines. $\endgroup$
    – Heike
    Commented Jan 30, 2012 at 19:57

1 Answer 1


No solution with 3D return, but you can "vectorize" 3D graphics by using the good ole ImportString[ExportString[...]] trick which results in a (large) 2D Graphicsexpression:

g = Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]

enter image description here

vectorized2D = ImportString[ExportString[g, "PDF"], "PDF"][[1]]

enter image description here

This is now a Graphics expression that you can use to extract certain features:

Cases[vectorized2D, _JoinedCurve, Infinity] // Graphics

enter image description here

but finding the right patterns for the stuff you might want to work with could take some effort. Also you have to live with the fact that some appearances will change more or less dramatically.

  • 1
    $\begingroup$ Going through PDF has the effect that (at least in my test, on the numbers are translated into curves as well. I've found that when going through EPS instead, the numbers are kept as text (but then, for some reason the polygons were very wrong). $\endgroup$
    – celtschk
    Commented Feb 21, 2012 at 15:15
  • $\begingroup$ This sure is something that is changing a lot behind the scenes from version to version. I hope that there will be some kind of useful convergence in versions to come (e.g. an extension of FilledCurve to 3D would be very, very useful and much in the spirit of the already existing 2D+3D graphics primitives). $\endgroup$
    – Yves Klett
    Commented Feb 22, 2012 at 14:46

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.