本文整理汇总了Python中mpl_toolkits.mplot3d.Axes3D.set_ylim方法的典型用法代码示例。如果您正苦于以下问题:Python Axes3D.set_ylim方法的具体用法?Python Axes3D.set_ylim怎么用?Python Axes3D.set_ylim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpl_toolkits.mplot3d.Axes3D
的用法示例。
在下文中一共展示了Axes3D.set_ylim方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plotData2files
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_ylim [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: plotData
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_ylim [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)
示例3: plotFigures
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_ylim [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)
示例4: main
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_ylim [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)
示例5: plotElements
# 需要导入模块: from mpl_toolkits.mplot3d import Axes3D [as 别名]
# 或者: from mpl_toolkits.mplot3d.Axes3D import set_ylim [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)