我已经成功地使用matplotlib创建了这个图形。我想删除0.2,0.4,0.6。。从名为B的轴,将A轴的轴间距从200更改为100。我已经尝试了很长时间了…有什么建议吗??在
这是我写的代码。在from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
f_attributes=open("continuous.data","r")
x=[]
y=[]
spam=[]
count=1
skew=[]
fig = plt.figure()
ax = Axes3D(fig)
total=[]
while count<=1024:
attributes=f_attributes.readline()
attributes=attributes.replace(".\n","")
attributes=attributes.split(',')
classification=int(attributes[10].replace(".\n",""))
if float(attributes[8]) >=0:
skew.append(float(attributes[8]))
x.append(count)
y.append(classification)
if classification == 0:
ax.scatter(x, y, skew, c='g', marker='o')
else:
ax.scatter(x, y, skew, c='r', marker='o')
x=[]
y=[]
skew=[]
count+=1
ax.set_xlabel('A')
ax.set_ylabel('B')
ax.set_zlabel('C')
plt.show()
请忽略不相关的细节。。在