我正在使用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