To answer the last part of question, this can be done by setting something like ViewPoint -> Dynamic[vp]
in the plot definition. Then the value of vp
will be dynamically updated to the current view point when you rotate the plot. Try for example
Plot3D[x^4 y, {x, 0, 1}, {y, 0, Pi}, PlotRange -> All, ViewPoint -> Dynamic[vp]]
Dynamic[vp]
Note that vp
must be defined as a triple of numbers.
As for the first part of your question, I don't know how you're creating your plot, but if you're using Plot3D
you could just swap the second and third argument. For example
vp = {1, 1, 1};
Plot3D[x^4 y Sin[5 y], {x, 0, 1}, {y, 0, Pi}, PlotRange -> All,
ViewPoint -> Dynamic[vp]]
Plot3D[x^4 y Sin[5 y], {y, 0, Pi}, {x, 0, 1}, PlotRange -> All,
ViewPoint -> Dynamic[vp[[{2, 1, 3}]]]]
Note that this will effectively swap the x- and y-axis, thus changing the coordinate system from being right-handed to left-handed.