当前位置: 首页>>代码示例>>Python>>正文


Python Axes3D.set_zlabel方法代码示例

本文整理汇总了Python中mpl_toolkits.mplot3d.Axes3D.set_zlabel方法的典型用法代码示例。如果您正苦于以下问题:Python Axes3D.set_zlabel方法的具体用法?Python Axes3D.set_zlabel怎么用?Python Axes3D.set_zlabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mpl_toolkits.mplot3d.Axes3D的用法示例。


在下文中一共展示了Axes3D.set_zlabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: custom_plot

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlabel [as 别名]
 def custom_plot(self, additional):
     for k in additional:
         if(k == Simulation.DISCRETIZE):
             for i in range(self.examples.noutputs):
                 for j in range(self.nbr_epoch):
                     if(self.plots['discretize_div'][i][j] != 0):
                         self.plots['discretize'][i][j] /= (self.plots['discretize_div'][i][j] * (self.nbDiscre ** self.nbDiscre))
             
             colors = [(0.2, 0.8, 0.88), 'b', 'g', 'r', 'c', 'm', 'y', 'k', (0.8, 0.1, 0.8), (0., 0.2, 0.5)]
     
             fig = plt.figure()
             ax = fig.add_subplot(111, projection='3d')
             for j in range(self.examples.noutputs):
                 ax.scatter([self.plots['discretize'][j][k] for k in self.plots['discretize_valid'][j]], [j] * 
                             len(self.plots['discretize_valid'][j]), self.plots['discretize_valid'][j], color=colors[j], marker='x')
         
             ax.set_xlabel('DISCRETIZED VALUE')
             ax.set_ylabel('SHAPE')
             ax.set_zlabel('EPOCH')
             
             path = "/tmp/pyplot.%s.%s.png" % (sys.argv[0], time.strftime("%m-%d-%H-%M-%S", time.localtime()))
             plt.savefig(path)
             plt.show()
             
             
             plt.title('Discretize hidden layer')
             plt.ylabel('DISCRETIZED VALUE')
             plt.xlabel("EPOCHS")
             for j in range(self.examples.noutputs):
                 plt.plot(self.plots['discretize_valid'][j], [self.plots['discretize'][j][k] 
                                                              for k in self.plots['discretize_valid'][j]], '.', color=colors[j])
             path = "/tmp/pyplot.%s.%s.png" % (sys.argv[0], time.strftime("%m-%d-%H-%M-%S", time.localtime()))
             try:
                 plt.savefig(path)
             except ValueError:
                 print('Cannot save discretize_cloud')
             try:
                 plt.show()
             except ValueError:
                 print('Cannot display discretize_cloud')
         elif(k == Simulation.PROTOTYPE):
             lplot = [[0. for _ in range(self.examples.ninputs)] for _ in range(self.examples.noutputs)]
             for network in self.networks:
                 for i in range(len(self.examples.inputs)):
                     network['FoN'].calc_output(self.examples.inputs[i])
                     network['SoN'].calc_output(network['FoN'].stateHiddenNeurons)
                     
                     im = index_max(self.examples.outputs[i])
                     
                     for j in range(self.examples.ninputs):
                         lplot[im][j] += network['SoN'].stateOutputNeurons[j]
             
             fig = plt.figure()
             plt.clf()
             for i in range(self.examples.noutputs):
                 rpr.show_repr(lplot[i], self.width, fig, 250 + i, i)
             path = "/tmp/pyplot.%s.%s.png" % (sys.argv[0], time.strftime("%m-%d-%H-%M-%S", time.localtime()))
             plt.savefig(path)
             plt.show()
开发者ID:matthieu637,项目名称:anne,代码行数:61,代码来源:simulation.py

示例2: saveoutput

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlabel [as 别名]

#.........这里部分代码省略.........
        title('$I_{DS}$ vs. $V_{DS}$')
        savefig('ID_VD.png')

        #temmm = [Vd_bias, Ie[0,:]]
        #np.savetxt('ID_VD.dat', temmm, fmt='%e', delimiter=';')
        temmm = Vd_bias
        Ie2 = Ie.transpose()
        fid = open('ID_{VD}.dat','w')
        ind = 0
        for item1 in temmm:
            fid.write("%e " % item1)
            for item2 in Ie2[ind,:]:
                fid.write("%e " % item2)
            fid.write('\n')
            ind += 1
        fid.close()
    #if plot_Iv==1 end

    #***************************************************************************************
    # Ec(X,Y)
    # -------------------------------------------
    if plot_Ec3d == 1:
        figure(6)
        [X, Y] = np.meshgrid(XI, YI)
        Z = trMEc
        ax = gca(projection = '3d')
        surf = ax.plot_surface(X, Y, Z, rstride=3, cstride=3, cmap=cm.coolwarm, linewidth=0.5, antialiased = True)

        #surf(XI,YI,trMEc)
        #shading interp commented out to reduce size of the .ps file
        title('3D Conduction band edge potential profile')
        ax.set_xlabel('X [nm]')
        ax.set_ylabel('Y [nm]')
        ax.set_zlabel('Ec [eV]')
        ax.view_init(elev=60, azim=50)
        ax.dist=8
        savefig('Ec_X_Y.png')

        XII = (0, XI)
        tem1 = (YI, trMEc)
        tem2 = (XII, tem1)
        #np.savetxt('Ec_X_Y.dat', tem2, fmt='%e', delimiter=';')
        #f1 = open('Ec_X_Y','w')
        #writer = csv.writer(f1, delimiter = ',')
        #writer.writerows(tem2)



   #*******************************************************************************************
    if (plot_Ecsub==1 and max_subband>=1):
        figure(8)
        for iii in np.arange(0,max_subband):
            plot(XI, E_sub[0, Ng_step, Nd_step, :, iii],'r-')
            hold(True)
            grid(True)
            if (t_vall==3):
                plot(XI, E_sub[1, Ng_step, Nd_step, :,iii],'k-')
                plot(XI, E_sub[2, Ng_step, Nd_step, :,iii],'-')

        title('The Subbands energy profile along the channel')
        xlabel('X [nm]')
        ylabel('E_{SUB} [eV]')
        savefig('Ec_sub_X.png')

    ############################################################################################
    if (plot_Nesub==1 and max_subband>=1):
开发者ID:karnatyrohit,项目名称:nanomos2.5_python,代码行数:70,代码来源:saveoutput.py


注:本文中的mpl_toolkits.mplot3d.Axes3D.set_zlabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。