user3670781 user3670781 - 11 months ago 78
Python Question

How to disable perspective in mplot3d?

Is it possible to disable the perspective when plotting in mplot3d, i.e. to use the orthogonal projection?


Sort of, you can run this snippet of code before you plot:

import numpy
from mpl_toolkits.mplot3d import proj3d
def orthogonal_proj(zfront, zback):
    a = (zfront+zback)/(zfront-zback)
    b = -2*(zfront*zback)/(zfront-zback)
    return numpy.array([[1,0,0,0],
proj3d.persp_transformation = orthogonal_proj

It is currently an open issue found here.