python的三维坐标轴设置_如何更改matplotlib中的三维轴设置

在matplotlib中,已经成功创建了一个三维图形,现在需要调整坐标轴的显示。具体需求是移除B轴上的特定刻度,并将A轴的刻度间隔从200改为100。目前的代码读取数据并生成散点图,但尚未实现坐标轴的定制。寻求解决方案。
摘要由CSDN通过智能技术生成

aefa33aeac2d42fa0af24126c70856d7.png

我已经成功地使用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()

请忽略不相关的细节。。在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值