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


Python Axes3D.scatter方法代码示例

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


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

示例1: plotData

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plotData(tuplesArray):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    
    
    x = []
    y = []
    z = []
    
    for point in tuplesArray:
        x.append(point[0])
        y.append(point[1])
        z.append(point[2])
    

    if (FILEInQuestion == "newsbp.fuselageZ.dat"):
        Axes3D.scatter(ax, x,y,z, s=30, c ='b')
        
        Axes3D.set_zlim(ax, [0, 1000])
        Axes3D.set_ylim(ax, [0, 3000])
        Axes3D.set_xlim(ax, [0, 3000])
        
        ax.set_xlabel('Z axis')
        ax.set_ylabel('X axis')
        ax.set_zlabel('Y axis')
    else:
        Axes3D.scatter(ax, z,x,y, s=30, c ='b')
        
        ax.set_xlabel('Z axis')
        ax.set_ylabel('X axis')
        ax.set_zlabel('Y axis')

    plt.show(block=True)
开发者ID:manmeetb,项目名称:Free-Form-Deformation,代码行数:35,代码来源:plotCRMWingBody.py

示例2: plot_cam_location

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plot_cam_location(camera_list, n, fig=None, ax=None):
	FigSz = (8, 8)
	L = np.array([list(c.location[n]) for c in camera_list])
	x = L[:, 0]
	y = L[:, 1]
	z = L[:, 2]
	if not fig:
		fig = plt.figure(figsize=FigSz)
	#view1 = np.array([-85., 60.])
	if not ax:
		ax = Axes3D(fig) #, azim=view1[0], elev=view1[1])
	Axes3D.scatter(ax, x, y, zs=z, color='k')
	zer = np.array
	Axes3D.scatter(ax, zer([0]), zer([0]), zs=zer([5]), color='r')
	ax.set_xlabel('X')
	ax.set_ylabel('Y')
	ax.set_zlabel('Z')
	ax.set_ylim3d(-50, 50)
	ax.set_xlim3d(-50, 50)
	ax.set_zlim3d(0, 50)
	#if Flag['ShowPositions']:
	fig.show()
	#else:
	#	fig.savefig(fName)
	return ax, fig
开发者ID:marklescroart,项目名称:bvp,代码行数:27,代码来源:plot.py

示例3: plotFiguresTemp

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plotFiguresTemp(xSolid, ySolid, zSolid, xFFDDeform, yFFDDeform, zFFDDeform):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')

    #fig = plt.figure()
    #ax = fig.gca(projection='3d')

    # Axes3D.plot_wireframe(ax, z, x, y)
    ax.set_xlabel('Z axis')
    ax.set_ylabel('X axis')
    ax.set_zlabel('Y axis')

    #ax.plot_trisurf(zSolid, xSolid, ySolid, cmap=cm.jet, linewidth=0.2)
    ax.plot_wireframe(zSolid, xSolid, ySolid, rstride = 1, cstride = 1, color="y")

    #Axes3D.scatter(ax, zSolid, xSolid, ySolid, s=10, c='b')
    Axes3D.scatter(ax, zFFDDeform, xFFDDeform, yFFDDeform, s=30, c='r')

    # Axes3D.set_ylim(ax, [-0.5,4.5])
    # Axes3D.set_xlim(ax, [-0.5,4.5])
    Axes3D.set_zlim(ax, [-0.7, 0.7])




    plt.show(block=True)
开发者ID:manmeetb,项目名称:Free-Form-Deformation,代码行数:28,代码来源:plotSurface.py

示例4: volume_display

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
 def volume_display(self, zstep = 3.00):
     """
     This is a daring attempt for 3-D plots of all the blobs in the brain. 
     Prerequisites: self.blobs_archive are established.
     The magnification of the microscope must be known.
     """
     fig3 = plt.figure(figsize = (10,6))
     ax_3d = fig3.add_subplot(111, projection = '3d')
     
     for n_frame in self.valid_frames:
         # below the coordinates of the cells are computed.
         blobs_list = self.c_list[n_frame] 
         ys = blobs_list[:,0]*magni_lateral
         xs = blobs_list[:,1]*magni_lateral 
         zs = np.ones(len(blobs_list))*n_frame*zstep
         ss = (np.sqrt(2)*blobs_list[:,2]*magni_lateral)**2*np.pi
         Axes3D.scatter(xs,ys, zs, zdir = 'z', s=ss, c='g')        
     
     
     
     ax_3d.set_xlabel('x (micron)', fontsize = 12)
     ax_3d.set_xlabel('y (micron)', fontsize = 12)
     
     return fig3
     
开发者ID:Huanglab-ucsf,项目名称:Image_toolbox,代码行数:26,代码来源:Cell_extract.py

示例5: plotData2files

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plotData2files(tuplesArray1, tuplesArray2):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    
    
    x1 = []
    y1 = []
    z1 = []
    
    for point in tuplesArray1:
        x1.append(point[0])
        y1.append(point[1])
        z1.append(point[2])
    
    x2 = []
    y2 = []
    z2 = []
    
    for point in tuplesArray2:
        x2.append(point[0])
        y2.append(point[1])
        z2.append(point[2])
    
    Axes3D.scatter(ax, x1,y1,z1, s=30, c ='b')
    Axes3D.scatter(ax, x2,y2,z2, s=30, c ='r')

    Axes3D.set_xlim(ax, [0, 2000])
    Axes3D.set_ylim(ax, [0, 3000])
    Axes3D.set_zlim(ax, [0, 1000])

    plt.show(block=True)
开发者ID:manmeetb,项目名称:Free-Form-Deformation,代码行数:33,代码来源:plotCRMWingBody.py

示例6: plotFigures

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plotFigures(xSolid,ySolid,zSolid,xFFDDeform,yFFDDeform,zFFDDeform, xsolidInitial,
               ysolidInitial, zsolidInitial, xFFDInitial, yFFDInitial, zFFDInitial):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')


    # Axes3D.plot_wireframe(ax, z, x, y)
    ax.set_xlabel('Z axis')
    ax.set_ylabel('X axis')
    ax.set_zlabel('Y axis')

#Axes3D.scatter(ax, zSolid, xSolid, ySolid, s=10, c='b')
    #Axes3D.plot_wireframe(ax, zSolid, xSolid, ySolid, rstride = 1, cstride = 1, color="b")
#Axes3D.scatter(ax, zFFDDeform, xFFDDeform, yFFDDeform, s=30, c='r')

    Axes3D.scatter(ax, zsolidInitial, xsolidInitial, ysolidInitial, s=10, c='b')
    #Axes3D.plot_wireframe(ax, zsolidInitial, xsolidInitial, ysolidInitial,rstride = 1, cstride = 1, color="y")
    Axes3D.scatter(ax, zFFDInitial, xFFDInitial, yFFDInitial, s=30, c='r')


    if (CONST_BodyType == "halfFuselage"):
        Axes3D.set_zlim(ax, [0, 4])
        Axes3D.set_ylim(ax, [0, 4])
        Axes3D.set_xlim(ax, [0, 12])
    else:
        #Axes3D.set_ylim(ax, [-0.5,4.5])
        #Axes3D.set_xlim(ax, [-0.5,4.5])
        Axes3D.set_zlim(ax, [-1.2, 1.2])

    plt.show(block=True)
开发者ID:manmeetb,项目名称:Free-Form-Deformation,代码行数:32,代码来源:plotPython.py

示例7: plotFigures

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plotFigures(xSolid,ySolid,zSolid,xFFDDeform,yFFDDeform,zFFDDeform, xsolidInitial,
               ysolidInitial, zsolidInitial, xFFDInitial, yFFDInitial, zFFDInitial):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')


    # Axes3D.plot_wireframe(ax, z, x, y)
    ax.set_xlabel('Z axis')
    ax.set_ylabel('X axis')
    ax.set_zlabel('Y axis')

    #Axes3D.scatter(ax, zSolid, xSolid, ySolid, s=10, c='b')
    Axes3D.plot_wireframe(ax, zSolid, xSolid, ySolid, rstride = 1, cstride = 1, color="b")
    Axes3D.scatter(ax, zFFDDeform, xFFDDeform, yFFDDeform, s=30, c='r')

    #Axes3D.scatter(ax, zsolidInitial, xsolidInitial, ysolidInitial, s=10, c='y')
    Axes3D.plot_wireframe(ax, zsolidInitial, xsolidInitial, ysolidInitial,rstride = 1, cstride = 1, color="y")
    Axes3D.scatter(ax, zFFDInitial, xFFDInitial, yFFDInitial, s=30, c='g')

    xZCross = []
    yZCross = []
    zZCross = []

    #plot the points for the limits of each cross section
    for zCrossSect in GLOBAL_zCrossSectionObjects:
        zCrossSectionObject = GLOBAL_zCrossSectionObjects[zCrossSect]

        #add to the arrays, for a fixed z, the following combinations
        # (xmax, ymax) (xmax, ymin) (xmin, ymin) (xmin, ymax)

        # (xmax, ymax)
        xZCross.append(zCrossSectionObject.getXMax())
        yZCross.append(zCrossSectionObject.getYMax())
        zZCross.append(zCrossSect)

        #(xmax, ymin)
        xZCross.append(zCrossSectionObject.getXMax())
        yZCross.append(zCrossSectionObject.getYMin())
        zZCross.append(zCrossSect)

        #(xmin, ymin)
        xZCross.append(zCrossSectionObject.getXMin())
        yZCross.append(zCrossSectionObject.getYMin())
        zZCross.append(zCrossSect)

        #(xmin, ymax)
        xZCross.append(zCrossSectionObject.getXMin())
        yZCross.append(zCrossSectionObject.getYMax())
        zZCross.append(zCrossSect)

    #Axes3D.plot_wireframe(ax, zZCross, xZCross, yZCross)



    #Axes3D.set_ylim(ax, [-0.5,4.5])
    #Axes3D.set_xlim(ax, [-0.5,4.5])
    Axes3D.set_zlim(ax, [-0.7, 0.7])

    plt.show(block=True)
开发者ID:manmeetb,项目名称:Free-Form-Deformation,代码行数:61,代码来源:FFDPoints.py

示例8: custom_plot

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [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

示例9: main

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def main():
    # initialize ros node
    rospy.init_node('compute_calibration')

    # get path to folder containing recorded data
    filesPath = rospy.get_param('~files_path')

    # load trajectories
    kinectTraj = np.loadtxt('%skinect_trajectory' % (filesPath), delimiter=',')
    baxterTraj = np.loadtxt('%sbaxter_trajectory' % (filesPath), delimiter=',')

    # compute absolute orientation
    kinectOut, rot, trans = absOrientation(kinectTraj,baxterTraj)

    # plot both point sets together
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')

    # plot the data
    Axes3D.scatter(ax, kinectOut[:,0], kinectOut[:,1], kinectOut[:,2], s=20, c='r')
    Axes3D.scatter(ax, baxterTraj[:,0],baxterTraj[:,1], baxterTraj[:,2], s=20, c='b')

    # add labels and title
    ax.set_xticks([])
    ax.set_yticks([])
    ax.set_zticks([])
    ax.set_xlabel('X-axis')
    ax.set_ylabel('Y-axis')
    ax.set_zlabel('Z-axis')
    plt.title('Kinect-Baxter Calibration')
    plt.legend(['Kinect','Baxter'])
    plt.show()

    # get rotation matrix as quaternion and euler angles
    euler = tf.transformations.euler_from_matrix(rot)
    quat = tf.transformations.quaternion_from_euler(*euler)

    # save results to yaml file
    f = open('%skinect_calibration.yaml' % (filesPath), 'w')
    lines = ['trans: [', 'rot: [', 'rot_euler: [']

    for elem in trans: lines[0] += str(elem) + ', '
    lines[0] += ']\n'
    for elem in quat: lines[1] += str(elem) + ', '
    lines[1] += ']\n'
    for elem in euler: lines[2] += str(elem) + ', '
    lines[2] += ']\n'

    lines.append('parent: /base\n')
    lines.append('child: /kinect2_link\n')

    f.writelines(lines)
    f.close()
开发者ID:ShibataLabPrivate,项目名称:kinect_baxter_calibration,代码行数:55,代码来源:compute_calibration.py

示例10: plotPCA

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plotPCA(proj3D, X_r, PCs, ligs, colors, csvPath, save_flag):
    """
    Plot the PCA data on 2D plot
    """

    # Main figure
    fig = plt.figure(figsize=(13, 12), dpi=100)

    if proj3D:
        ax = fig.add_subplot(111, projection="3d")
        for label, col, x, y, z in zip(ligs, colors,
                                       X_r[:, 0], X_r[:, 1], X_r[:, 2]):
            newCol = makeColor(col)
            Axes3D.scatter(ax, x, y, z, label=label, color=newCol,
                           marker="o", lw=1, s=800)
        ax.set_xlabel("PC1 (" + '{0:g}'.format(PCs[0]) + " %)", fontsize=30)
        ax.set_ylabel("PC2 (" + '{0:g}'.format(PCs[1]) + " %)", fontsize=30)
        ax.set_zlabel("PC3 (" + '{0:g}'.format(PCs[2]) + " %)", fontsize=30)
        ax.tick_params(axis="both", which="major", labelsize=20)
        pngPath = csvPath.replace(".csv", "_3D.png")
    else:
        ax = fig.add_subplot(111)
        for label, col, x, y in zip(ligs, colors, X_r[:, 0], X_r[:, 1]):
            newCol = makeColor(col)
            ax.scatter(x, y, label=label, color=newCol, marker="o", lw=1, s=800)
            # ax.annotate(label, xy=(x, y - 0.05), fontsize=10,
            #             ha='center', va='top')
        ax.set_xlabel("PC1 (" + '{0:g}'.format(PCs[0]) + " %)", fontsize=30)
        ax.set_ylabel("PC2 (" + '{0:g}'.format(PCs[1]) + " %)", fontsize=30)
        ax.tick_params(axis="both", which="major", labelsize=30)
        pngPath = csvPath.replace(".csv", "_2D.png")

    # figTitle = "PCA on " + csvPath + " (PC1=" + pcVals[0] + ", PC2=" +
    # pcVals[1] + ")"
    # ax.text(0.5, 1.04, figTitle, horizontalalignment="center", fontsize=30,
    #         transform=ax.transAxes)

    # Legend figure
    fig_legend = plt.figure(figsize=(13, 12), dpi=100)
    plt.figlegend(*ax.get_legend_handles_labels(), scatterpoints=1,
                  loc="center", fancybox=True,
                  shadow=True, prop={"size": 30})

    # Save figures if save flag was used
    if save_flag:
        print("\nSAVING figures\n")
        fig.savefig(pngPath, bbox_inches="tight")
        fig_legend.savefig(pngPath.replace(".png", "_legend.png"))
    # Otherwise show the plots
    else:
        print("\nSHOWING figures\n")
        plt.show()
开发者ID:mlskit,项目名称:astromlskit,代码行数:54,代码来源:pca_analysis.py

示例11: main

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def main():
    global rR
    global v
    #v = polynomial_surface2(rR)
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    v=[  345.01147843,  -731.53883648,   701.43498064,  -333.41157482,    61.69405675,   434.95848754,  -734.92037163,   468.45066799,  -108.66899203,   197.05683428,  -229.38490931,    73.72852732,    38.62490216,   -23.11704968,     2.79760705,  1112.02959271, -1850.90352232,  1243.44148281,  -301.1366546,   1096.50133704, -1278.21349214,   419.17838208,   338.80540403,  -201.95899053,    33.68403733,  1333.97626976, -1566.15905716,   552.3302448,    922.09578713,  -558.92492054,   145.7445413,    705.90344671, -442.88105472,   259.89354682,   138.22604583]
    #ax=implicit.plot_implicit(fn4,bbox=(-1.5,0,-3.5,-1.5,-2,1),rc=200,ns=30,colors='b', ax=ax)
    v=[  2.18930311,   0.24260729,  57.46589779,   3.38543536,  -9.56889825,  34.36258001, -36.2221404,    4.86597348,  12.89329227,  21.10709896,  -4.36372996,  -5.89323474,   3.98227029,   0.9848254,    0.23593784, -36.46890674, -25.34400559,  81.86028261,  14.43120124,  44.89510312, -52.04801532,  -9.90597384,  16.49023335,   2.29875215,   0.40597427, -55.46318028, -39.9563639,   26.95078929,  35.15384941, -18.2399162,   5.13417155, -31.78519693, -14.89522473,  10.38829065,  -6.66988281]
    #ax=implicit.plot_implicit(fn4,bbox=(-1.5,0,-3.5,-1.5,-2,1),rc=200,ns=30,colors='r', ax=ax)
    #rR = tree_time.tree_time(rR,0.05)
    rR=array(rR)
    Axes3D.scatter(ax,rR[:,0],rR[:,1],rR[:,2])
    Axes3D.scatter(ax,-0.87676517,-2.5211104,-0.76908632,color='green') 
    plt.show()
开发者ID:OpenLEAD,项目名称:coatinglib,代码行数:17,代码来源:polynomial_surface.py

示例12: updatePlot

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
    def updatePlot(self, X, Y, Z, population=None):
        self.activePlot = (X,Y,Z)
        x, y = np.meshgrid(X,Y)

        if self.surface is not None:
            self.surface.remove()

        if self.scatter is not None:
            self.scatter.remove()

        # surface
        self.surface = Axes3D.plot_surface(
                self.axes,
                x, y, Z,
                rstride=1,
                cstride=1,
                cmap=cm.coolwarm,
                linewidth=0,
                antialiased=False,
                shade=False,
                alpha=0.5
        )

        # population
        if population is not None:
            self.activePopulation = population
            x, y, z = self.preparePopulationData(population)
            self.scatter = Axes3D.scatter(self.axes, x, y, z, c="r", marker="o")
            self.scatter.set_alpha(1.0)

        # Draw all
        self.canvas.draw()
        self.canvas.flush_events()
开发者ID:Nialaren,项目名称:bia_project,代码行数:35,代码来源:matplotlibPlotHandler.py

示例13: plotFiguresTemp

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plotFiguresTemp(xSolid, ySolid, zSolid, xFFDDeform, yFFDDeform, zFFDDeform):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')

    # Axes3D.plot_wireframe(ax, z, x, y)
    ax.set_xlabel('Z axis')
    ax.set_ylabel('X axis')
    ax.set_zlabel('Y axis')

    Axes3D.scatter(ax, zSolid, xSolid, ySolid, s=10, c='b')
    Axes3D.scatter(ax, zFFDDeform, xFFDDeform, yFFDDeform, s=30, c='r')

    # Axes3D.set_ylim(ax, [-0.5,4.5])
    # Axes3D.set_xlim(ax, [-0.5,4.5])
    Axes3D.set_zlim(ax, [-0.7, 0.7])

    plt.show(block=True)
开发者ID:manmeetb,项目名称:Free-Form-Deformation,代码行数:19,代码来源:FFDPoints.py

示例14: plotElements

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def plotElements(PhysicalElementMatrix):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    
    # Axes3D.plot_wireframe(ax, z, x, y)
    ax.set_xlabel('X axis')
    ax.set_ylabel('Y axis')
    ax.set_zlabel('Z axis')
    

    xVector = []
    yVector = []
    zVector = []
    for i in range(CONST_DIMENSION_X):
        for j in range(CONST_DIMENSION_Y):
            for k in range(CONST_DIMENSION_Z):
                elementObject = PhysicalElementMatrix[i][j][k]
                for gridPointObject in elementObject.gridPointList:
                    xVector.append(gridPointObject.getX())
                    yVector.append(gridPointObject.getY())
                    zVector.append(gridPointObject.getZ())

    Axes3D.scatter(ax, xVector, yVector, zVector, s=30, c='r')

    #Axes3D.plot_wireframe(ax, zSolid, xSolid, ySolid, rstride = 1, cstride = 1, color="b")



    # create the lines around all the elements
    for i in range(CONST_DIMENSION_X):
        for j in range(CONST_DIMENSION_Y):
            for k in range(CONST_DIMENSION_Z):
                elementObject = PhysicalElementMatrix[i][j][k]
                ListXVectors,ListYVectors,ListZVectors = elementObject.getOuterLineVectors()
                for l in range(len(ListXVectors)):
                    plt.plot(ListXVectors[l],ListYVectors[l], ListZVectors[l], c = 'b')

    Axes3D.set_ylim(ax, [-10,10])
    Axes3D.set_xlim(ax, [-10,10])
    Axes3D.set_zlim(ax, [-10, 10])
    

    plt.show(block=True)
开发者ID:manmeetb,项目名称:Higher-Order,代码行数:45,代码来源:3Ddeformgrid.py

示例15: addcurve

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import scatter [as 别名]
def addcurve( ax, path, endpoints, color ) :
  px = path[ :,0 ]
  py = path[ :,1 ]
  pz = path[ :,2 ]
  n = len(px) - 1
  q = Axes3D.plot(ax, px, py, zs=pz, c=color, linewidth=2 )
  px = endpoints[ :,0 ]
  py = endpoints[ :,1 ]
  pz = endpoints[ :,2 ]
  print px, py, pz
  q = Axes3D.scatter(ax, px,py, zs=pz, c=color, marker='o', s=60)
开发者ID:richardplambeck,项目名称:tadpol,代码行数:13,代码来源:waveplate.py


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