本文整理汇总了Python中mpl_toolkits.mplot3d.Axes3D.set_zlim方法的典型用法代码示例。如果您正苦于以下问题:Python Axes3D.set_zlim方法的具体用法?Python Axes3D.set_zlim怎么用?Python Axes3D.set_zlim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpl_toolkits.mplot3d.Axes3D
的用法示例。
在下文中一共展示了Axes3D.set_zlim方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plotData2files
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [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)
示例2: plotFiguresTemp
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [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)
示例3: plotData
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [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)
示例4: plotFigures
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [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)
示例5: plotFigures
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [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)
示例6: main
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [as 别名]
def main():
# the list that will hold the solid boundary point data
# for the elements.
ElementsSbpDataInit = []
# the list that will hold the FFD data for the elements.
ElementsFFDDataInit = []
CONST_NumElements = loadData(ElementsSbpDataInit, ElementsFFDDataInit)
# the list that will hold the final solid boundary point data
# for the elements.
ElementsSbpDataFinal = []
# the list that will hold the final FFD data for the elements.
ElementsFFDDataFinal = []
CONST_NumElements = loadDataFinal(ElementsSbpDataFinal, ElementsFFDDataFinal)
# Plotting the elements
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
plotElements(fig, ax, ElementsSbpDataInit,ElementsFFDDataInit, \
CONST_NumElements, 'b', 'r', 'b', 'r')
#plotElements(fig,ax, ElementsSbpDataFinal, ElementsFFDDataFinal, \
#CONST_NumElements, 'y', 'g', 'y', 'g')
ax.set_xlabel('Z axis')
ax.set_ylabel('X axis')
ax.set_zlabel('Y axis')
Axes3D.set_xlim(ax, [0, 1900])
Axes3D.set_ylim(ax, [0, 3000])
Axes3D.set_zlim(ax, [0, 1000])
#Axes3D.set_xlim(ax, [-1, 8])
#Axes3D.set_ylim(ax, [-2, 6])
#Axes3D.set_zlim(ax, [0, 5])
if (CONST_ElementTag == "WingLess"):
# Axes3D.plot_wireframe(ax, z, x, y)
ax.set_xlabel('Z axis')
ax.set_ylabel('X axis')
ax.set_zlabel('Y axis')
Axes3D.set_xlim(ax, [0, 6])
Axes3D.set_ylim(ax, [-1.5, 2.5])
Axes3D.set_zlim(ax, [0, 2])
plt.show(block=True)
示例7: plotFiguresTemp
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [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)
示例8: plotElements
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [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)
示例9: plotInitialState
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [as 别名]
def plotInitialState(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, 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')
#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)
示例10: plotFFDPointsAndPlane
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_zlim [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)