A common problem for me is finding the right perspective for 3D graphics.

This example accepts the default viewpoint and produce this: default

Using the mouse, the image is manipulated to something like this: modified

How do I harvest the perspective information so that it can be added to the graphic? My goal is to avoid having to manual adjustments across many files and to automate my process. This precludes using "Save graphics as...".

And for extra credit, how to get rid of white space? Trim Bounding Box produces this unsatisfactory result.


  • $\begingroup$ I typically make a Manipulate and adjust the three parameters to find the best Viewpoint. $\endgroup$ Apr 26, 2017 at 23:06
  • $\begingroup$ @David G. Stork: Are there other parameters, like distance? $\endgroup$
    – dantopa
    Apr 26, 2017 at 23:14
  • $\begingroup$ Distance is derived from the three coordinates: {1,1,1} and {10,10,10} are from the same direction, but different distances. $\endgroup$ Apr 26, 2017 at 23:16
  • 1
    $\begingroup$ ... and simply click on the teeny + signs at the right of each slider to read their values. Manipulate[ Graphics3D[{Opacity[0.5], Sphere[], Red, Thickness[0.02], Line[{{0, 0, 0}, {1, 1, 1}}]}, ViewPoint -> {x, y, z}], {{x, 1}, -5, 5}, {{y, 1}, -5, 5}, {{z, 1}, -5, 5 }] $\endgroup$ Apr 26, 2017 at 23:20
  • 2
    $\begingroup$ See this previous question: Extract current viewing parameters from a 3D view? $\endgroup$
    – user484
    Apr 27, 2017 at 0:49

1 Answer 1

 {Opacity[0.5], Sphere[], 
 Red, Thickness[0.02], Line[{{0, 0, 0}, {1, 1, 1}}]},
  ViewPoint -> {x, y, z}], 
  {{x, 1}, -5, 5, Appearance -> "Open"}, 
  {{y, 1}, -5, 5, Appearance -> "Open"}, 
  {{z, 1}, -5, 5, Appearance -> "Open"}]

or Appearance -> "Labeled"


if you want to copy the viewpoint, go to the teeny + at the upper-right corner of the Manipulate panel and select PasteSnapshot, which will paste the values of the parameters.

  • $\begingroup$ A very nice compliment to the answers in helpful link by @Rahul. $\endgroup$
    – dantopa
    Apr 27, 2017 at 3:08

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.