Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

It is easy to make 3D Plots with Mathematica, e.g. use:

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

But I want to have nice plots in my thesis, so I decided to use pgfplots for $\LaTeX$ together with Mathematica. There you can use a picture (of Mathematica) and draw with $\LaTeX$ well readable axes etc. around the picture (see e.g. p.44 et seq. here).

But to use both programs together, I need plots which are in a parallel and not perspective projection. As you can see from the pic, Picture with perspective projection

Mathematica gives me a perspective projection. Is there a way to get a parallel projection?

share|improve this question
1  
You can achieve an orthographic projection with the ViewMatrix option. The documentation has some usage examples. –  Thies Heidecke Oct 28 '12 at 16:54
1  
Why not something like Show[Graphics3D[{Thick, Black, Line[{{-3, -2, -1}, {5, -2, -1}}], Line[{{-3, -2, 1}, {5, -2, 1}}]}], Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]] ? –  b.gatessucks Oct 28 '12 at 17:03
    
@Thies Heidecke. Ok, this could help. But then I can never rotate my picture by hand, I have to calculate a lot just for one orthographic projection. And if I want to change my projection a bit, I have to calculate a lot again. Isn’t there a more convenient solution? b.gatessucks: I think you misunderstand the question, I do not want to have black lines in my picure, I want that the frame of my picture has parallel lines. If you check your solution you will see that this is not the case. –  partial81 Oct 28 '12 at 17:37
add comment

1 Answer 1

up vote 14 down vote accepted

How about using far-away ViewPoint coordinates? The left one uses the default ViewPoint, the right one has parallel projection.

{
 Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, ViewPoint -> {1.3, -2.4, 2.0}],
 Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, ViewPoint -> {1.3, -2.4, 2.0}*1000]
}

Mathematica graphics

You can also directly prettify the labels and ticks:

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, 
 LabelStyle -> Directive[14, Bold, Italic, FontFamily -> "Times"]]

Mathematica graphics

share|improve this answer
4  
For single axes specs you can conveniently use Infinity as in ViewPoint->{0,0,Infinity} –  Yves Klett Oct 28 '12 at 19:15
    
Thank you for this post! It took me a while to find the right ViewPoint for my real 3D Graphs, but now it works very well! Thanks also for the hint that one can improve in Mathematica directly the labels etc. If one is not as picky as me, this will work for sure too. @J. M. Thanks for the edit! –  partial81 Oct 29 '12 at 9:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.