matplotlib散点图:太多Xticks/yticks
因此,使用matplotlib散点图,我得到了一个看起来像这样的情节: 散点图
我试图绘制一长串坐标列表x和y轴标记每个点的标签,以无序的方式。我只想设置X和Y轴标签,例如(10,20,...,100),而不是每个点出现。
def visualise(self):
input_file = open("textFiles/points.txt", 'r')
xVals = []
yVals = []
for line in input_file:
line = line.split(",")
xVals.append(line[0])
yVals.append(line[1])
plt.scatter(xVals,yVals, s = 2)
plt.show()
So using matplotlib scatter plot, i am getting a plot that looks like this:
scatter plot
I am trying to plot a long list of coordinates however it appears to be making a seperate x and y axis label for every single point in an unordered manner. I just want to to have set x and y axis labels e.g. (10,20,...,100) instead of one appearing for every point.
def visualise(self):
input_file = open("textFiles/points.txt", 'r')
xVals = []
yVals = []
for line in input_file:
line = line.split(",")
xVals.append(line[0])
yVals.append(line[1])
plt.scatter(xVals,yVals, s = 2)
plt.show()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论