我正在使用matlibplot进行数据可视化。我的情节总共有6502个数据值,并且工作正常,但数值非常密集。python中matlibplot散点图的缩放轴
例如,我的y轴值在3到10之间,我需要清楚地知道它们之间的每个点。即像9.2和9.8这样的数值至少要用1 = 0.5的比例清楚地区分开来。 即所有的值如3,3.5,4,4.5 ... 10,10.5都在输出图中看到
有人可以解释我如何完成。我用最大和最小值累计设置范围。但它不起作用。我设置为3.5的限制到10.5,但在图中的轴显示与1 = 1的缩放和值从4到10,请帮我解决这个问题提前
感谢
这里是我的代码到目前为止
import matplotlib.pyplot as plt
import numpy as np
import plotly.plotly as py
c, ec = np.random.rand(2, len(votes), 10)
fig, ax = plt.subplots()
plt.ylim(3.5, 10.5)
plt.grid(True)
# where votes range from 10-1000000 and rank range from 3.5 to 10
matplotlib.pyplot.scatter(votes,rank, c=c, edgecolor=ec)
plot_url = py.plot_mpl(fig, filename='scatter-plot')
matplotlib.pyplot.show()
和我的情节在这里
目前尚不清楚您要发布的解决方案要么是什么问题。 – wwii 2014-12-13 06:33:13
我的代码运行良好。看到在我的阴谋y轴范围是从4到10.我希望它是从3.5到10.5,使我可以看到3.5,4,4.5,5 ... 10.5都看到 – 2014-12-13 06:41:25