2
$\begingroup$

How you do convert a Graph3D (or GraphPlot3D) into Graphics3D?

Graphics3D@ButterflyGraph[3]

enter image description here

Show[Graph3D@ButterflyGraph[3], ViewPoint -> {1, 1, 1}, 
 SphericalRegion -> True, Boxed -> False, ViewAngle -> Automatic, 
 BoxRatios -> 1, ImageSize -> 300, Background -> Black]

enter image description here

Update:

What confuses me is that changing the ViewPoint seems to kill the styling:

Show[Graph3D@ButterflyGraph[3], ViewPoint -> {1, 1, 1}]

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

Use Show

bg = ButterflyGraph[3];
Show[Graph3D @ bg]

Head[%]

Graphics3D

g3d = Graph3D[ButterflyGraph[3], ViewPoint -> {1, 1, 1}, 
   SphericalRegion -> True, Boxed -> False, ViewAngle -> Automatic, 
   BoxRatios -> 1, ImageSize -> 300, Background -> Black];
Head /@ {g3d, Show[g3d]}

{Graph, Graphics3D}

Row[{g3d, Show[g3d]}, Spacer[5]]

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Ah, I tried that but using Show seemed to kill the style (see updated screenshot). Try Show[Graph3D@ButterflyGraph[3], ViewPoint -> Front] does this maintain Graph3D's default blue vertices for you? $\endgroup$
    – M.R.
    Jan 22, 2019 at 18:30
  • $\begingroup$ @M.R, probably version/os-related. In version 11.3 (windows 10/84) it works fine. $\endgroup$
    – kglr
    Jan 22, 2019 at 18:34
  • 2
    $\begingroup$ @M.R. if you look at the options of the Graphics3D that is returned by Show, you see it has a directional lighting source. This interacts poorly with your viewpoint. To workaround, give the option Lighting -> "Neutral" along with the view point. $\endgroup$
    – Jason B.
    Jan 22, 2019 at 19:20

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.