Deglupta
Deglupta

Reputation: 25

Rotate 3d plot to look like 2d plot (no perspective)

I have created a 3d plot and want it to rotate so that the observer looks straight onto the yz-plane. I used ax.view_init(0,360) for this rotation but there is still some perspective, as you can see in the second picture. In a 2D plot the maroon and orange colored plots would meet exactly in the middle of the red plot as can be seen in the third picture. I intend to animate this rotation, and want to seemlessly continue with a 2D plot after the rotation, so ideally it would be possible to get rid of the perspective in this 3d environment, because I'm having a hard time matching the style of the 3d plot with a 2d plot. enter image description here enter image description here enter image description here

Upvotes: 0

Views: 1165

Answers (1)

gboffi
gboffi

Reputation: 25093

I'd like to post a complete example but you didn't help very much (no MVE), however you can specify the projection type when you instantiate the axes:

In [6]: import matplotlib.pyplot as plt 
   ...: from mpl_toolkits.mplot3d import Axes3D 
   ...: %matplotlib 
   ...:  
   ...: ax = plt.axes(projection='3d', proj_type='ortho') 
   ...: ax.view_init(0,360)                                                                        

enter image description here

Upvotes: 1

Related Questions