如何在mplot3d中禁用透视图? [英] How to disable perspective in mplot3d?

查看:95
本文介绍了如何在mplot3d中禁用透视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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],
                        [0,1,0,0],
                        [0,0,a,b],
                        [0,0,0,zback]])
proj3d.persp_transformation = orthogonal_proj

当前是一个未解决的问题,此处.

It is currently an open issue found here.

这篇关于如何在mplot3d中禁用透视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆