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


Python Axes3D.plot_wireframe方法代码示例

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


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

示例1: plotFigures

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

示例2: plotFiguresTemp

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import plot_wireframe [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.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, zPointArray, xPointArray, yPointArray, 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,代码行数:22,代码来源:plotPython.py

示例3: plotFFDPointsAndPlane

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import plot_wireframe [as 别名]
def plotFFDPointsAndPlane(xsolidInitial,ysolidInitial, zsolidInitial, xFFDInitial, yFFDInitial, zFFDInitial,
                          LeadingEdgeX, LeadingEdgeY, LeadingEdgeZ):
    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, zsolidInitial, xsolidInitial, ysolidInitial, s=10, c='y')
    #Axes3D.plot_wireframe(ax, zsolidInitial, xsolidInitial, ysolidInitial, rstride = 1, cstride = 1, color='y')
    #Axes3D.scatter(ax, LeadingEdgeZ, LeadingEdgeX, LeadingEdgeY, s=10, c='y')
    #Axes3D.plot_wireframe(ax, zSolid, xSolid, ySolid, rstride = 1, cstride = 1, color="b")
    Axes3D.scatter(ax, zFFDInitial, xFFDInitial, yFFDInitial, s=10, c='r')
    
    LeadingEdgeX1 = []
    LeadingEdgeY1 = []
    LeadingEdgeZ1 = []
    
    #Find all the leading edge points:
    for element in solidBoundaryPointArray:
        if((element.getLabel() == "LeadingEdge") or (element.getLabel() == "TrailingEdge")
           or (element.getLabel() == "WingTip") or (element.getLabel() == "WingRoot")):
            LeadingEdgeX1.append(element.getX())
            LeadingEdgeY1.append(element.getY())
            LeadingEdgeZ1.append(element.getZ())
    #Axes3D.scatter(ax, LeadingEdgeZ1, LeadingEdgeX1, LeadingEdgeY1, s=100, c='r')
    
    #plot the deformed wing and FFD point data
    
    xDeformed = []
    yDeformed = []
    zDeformed = []
    
    xFFDDeformed = []
    yFFDDeformed = []
    zFFDDeformed = []
    
    for element in solidBoundaryPointArray:
        xDeformed.append(element.getX())
        yDeformed.append(element.getY())
        zDeformed.append(element.getZ())
    
    # filling the FFD arrays
    for i in range(CONST_nXFDD):
        for j in range(CONST_nYFDD):
            for k in range(CONST_nZFDD):
                element = FFDPointArray[i][j][k]
                xFFDDeformed.append(element.getX())
                yFFDDeformed.append(element.getY())
                zFFDDeformed.append(element.getZ())
    """
        Axes3D.plot_wireframe(ax, zDeformed, xDeformed, yDeformed, rstride =1, cstride = 1, color='b')
        """
    Axes3D.scatter(ax, zDeformed, xDeformed, yDeformed, s=10, color='b')
    Axes3D.scatter(ax, zFFDDeformed, xFFDDeformed, yFFDDeformed, s=10, c='g')
    
    #takes a value for t,u,v. When a value is set to -1, then that parameter is free
    # to change while the one that is not set to -1 is the plane that needs to be drawn
    tuplesArray = plotIsoparametricLine(-1,-1,-1)
    xArray = []
    yArray = []
    zArray = []

    for a in tuplesArray:
        xArray.append(a[0])
        yArray.append(a[1])
        zArray.append(a[2])

    tuplesArray2 = plotIsoparametricLine(-1,-1,-1)
    xArray2 = []
    yArray2 = []
    zArray2 = []
    
    for a in tuplesArray2:
        xArray2.append(a[0])
        yArray2.append(a[1])
        zArray2.append(a[2])

    
    #Axes3D.scatter(ax, zArray, xArray, yArray, s=10, c='y')
    Axes3D.plot_wireframe(ax, zArray, xArray, yArray, rstride=1, cstride =1, color='g')
    Axes3D.plot_wireframe(ax, zArray2, xArray2, yArray2, rstride=1, cstride =1, color='g')

    #Axes3D.set_ylim(ax, [-0.5,4.5])
    #Axes3D.set_xlim(ax, [-0.5,4.5])
    Axes3D.set_zlim(ax, [-0.9, 0.9])
    plt.show(block=True)
开发者ID:manmeetb,项目名称:Free-Form-Deformation,代码行数:92,代码来源:constraintsStudy.py

示例4: range

# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import plot_wireframe [as 别名]
for n in range(n_t):  # loop over time
	u_past = u.copy() 
	for i in range(1,n_x-1): #loop over space
        	u[i] = u_past[i]  - beta*((u_past[i+1])**2-(u_past[i-1])**2)*0.5
  		plot(x,u)
	
	U = np.vstack([U, u])
    
plot.show()
plot.close()

fig = plt.figure()
Axes3D = fig.gca(projection='3d')
X, T = numpy.meshgrid(x,t)
Axes3D.plot_wireframe(X,T,U,rstride=20,cstride=10)
plt.show()
plt.close()

print "La segunda parte"




n_x = 200
c = 1.0
dx = 2.0/n_x
beta = 0.05
dt = beta*dx 
n_t = int(0.15/dt) 
x = linspace(0, 2.0, n_x)
开发者ID:Jdbermeo,项目名称:TareasComputacional,代码行数:32,代码来源:tarea7.py


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