Normally, I used ViewPoint in the code in Plot3D. Most of the time, I will use mouse to rotate the 3D object to get a better view point. The problem is, when I find the best view point for me, is there any way to get the ViewPoint parameters for the rotated scene, such as {-1.25, 2.31, 1.8}, so I can repeat the plot or use it in the future?
2 Answers
$\begingroup$ $\endgroup$
One way is to set a symbol equal to the initial default viewpoint.
v = Options[Plot3D, ViewPoint][[1, 2]] (* {1.3, -2.4, 2.} *) Use that symbol dynamically in the plot. Monitor the dynamic value of v and note the value when the rotated plot is pleasing to you:
Plot3D[ Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, ViewPoint -> Dynamic[v] ] 
Dynamic[v] (* {2, -0.9, 2.5} *) $\begingroup$ $\endgroup$
4 Here is how you can extract the ViewPoint family options from a graphic after interaction. Once you have the options, simply do a copy-paste them in the initial code :
- $\begingroup$ Duplicate of this, but maybe more attractive ? Should I delete or move my answer ? $\endgroup$andre314– andre3142017-03-10 14:24:25 +00:00Commented Mar 10, 2017 at 14:24
- 2$\begingroup$ This is a far more intuitive, and in my opinion more useful answer to the question. $\endgroup$user27119– user271192019-08-02 08:34:28 +00:00Commented Aug 2, 2019 at 8:34
- 1$\begingroup$ good answer. Very easy to use. $\endgroup$Nasser– Nasser2019-09-10 17:23:11 +00:00Commented Sep 10, 2019 at 17:23
- $\begingroup$ Beautiful use of
AbsoluteOptions. Love it. $\endgroup$alex– alex2024-11-29 12:23:38 +00:00Commented Nov 29, 2024 at 12:23

Options[..., ViewPoint]around the already rotated output. The graphics should be in the place of....ViewVerticalmay also change during rotating, as well as some other parameters. $\endgroup$