1
说我绘制柱状图Matplotlib主要定位器:的柱状图中
from matplotlib.ticker import IndexLocator
f , ax = plt.subplots(figsize=(10,5))
ax.bar(x, y, alpha=0.7, align='center')
我怎样才能调整主要定位器的位置,这样我每有一个吧?
我试着用:
ax.xaxis.set_major_locator(IndexLocator(x))
,但我得到:
TypeError: __init__() missing 1 required positional argument: 'offset'
不知道这是做正确的方式。
此外,为什么我的酒吧之间的间距关闭?
没有看到x的值,不能在酒吧间距评论。 – mdurant 2014-09-25 20:44:55