最後一個xtick可能是數據的最後一個值怎麼可能?熊貓和matplotlib xtick最大值設置
import pandas as pd
import matplotlib.pyplot as plt
a = [583, 1379, 1404, 5442, 5512, 5976, 5992, 6111, 6239, 6375, 6793, 6994, 7109, 7149, 7210, 7225, 7459, 8574, 9154, 9417, 9894, 10119, 10355, 10527, 11933, 12170, 12172, 12273, 12870, 13215, 13317, 13618, 13632, 13790, 14260, 14282, 14726, 15156, 19262, 21501, 21544, 21547, 21818, 21939, 22386, 22622, 22830, 23898, 25796, 26126, 26340, 28585, 28645, 28797, 28808, 28878, 29167, 29168, 31161, 31225, 32284, 32332, 32641, 33227, 34175, 34349, 34675, 34772, 34935, 35086]
d = pd.DataFrame(a)
d.hist(bins=50)
f = plt.figure()
plt.xlabel("xTEST")
plt.ylabel("yTEST")
plt.subplots_adjust(bottom=.25, left=.25)
plt.ticklabel_format(style = 'plain')
plt.title('Title here!', color='black')
plt.xlim(xmin=1, xmax=35086)
plt.show()
怎麼可能將最後一個xtick設置爲35086而不是35000? – user977828
相關問題:[如何在固定位置設置刻度,matplotlib](http://stackoverflow.com/q/17129947/832621) –