代码之家  ›  专栏  ›  技术社区  ›  user3165683

Axes3D.view_init()得到一个意外的关键字参数'roll'matplotlib

  •  0
  • user3165683  · 技术社区  · 1 年前

    我正在尝试更改matplotlib 3d投影的仰角、方位角和滚动,这应该是按照标准view_init进行的:

    https://matplotlib.org/stable/api/toolkits/mplot3d/view_angles.html

    然而,在尝试使用roll时,我遇到了一个错误:

    Axes3D.view_init() got an unexpected keyword argument 'roll'

    此功能是否仍然可用?

    请查看下面的代码:

    fig = plt.figure()
            ax = fig.gca(projection='3d')
            for ll in range(dataset[0][:,:,0:64].shape[2]):       
                xlist = [x for x in range(1, (len(dataset[0][frame,:, ll])+1))]
                plt.plot(
                    xs=np.clip(dataset[150,32,:,ll], 0,1),ys=xlist,  zs=ll, label='Raw ' + str(1))
                plt.title(("All A-scans of frame: " + str(frame)))
            ax.set_axis_off()
            ax.view_init(elev=30, azim=45, roll=15)
            plt.grid(True)
            plt.show()```
        
    
    0 回复  |  直到 1 年前