#由三个一维坐标画三维散点
#coding:utf-8
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D
x = []
y = []
z = []
f = open("data\\record.txt")
line = f.readline()
while line:
c,d,e = line.split()
x.append(c)
y.append(d)
z.append(e)
line = f.readline()
f.close()
#string型转int型
x = [ int( x ) for x in x if x ]
y = [ int( y ) for y in y if y ]
z = [ int( z ) for z in z if z ]
print x
fig=plt.figure()
ax=Axes3D(fig)
ax.scatter3D(x, y, z)
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
plt.show()
#
coding: utf - 8
from mpl_toolkits.mplot3d
import axes3d
import matplotlib.pyplot as plt
x = []
y = []
z = []
f = open("data\\record.txt")
line = f.readline()
while line:
c, d, e = line.split()
x.append(c)
y.append(d)
z.append(e)
line = f.readline()
f.close()
# string型转int型
x = [int(x) for x in x
if x
]
y = [int(y) for y in y
if y
]
z = [int(z) for z in z
if z
]
# print x
fig = plt.figure()
ax = fig.gca(projection = '3d')
ax.plot(x, y, z)
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
plt.show()
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有