我试着重新创建您的问题但不知道你的标签是什么,我只能给你关于这个问题的一般性评论。有几件事你可以做,以减少标签的重叠,包括他们的数量,他们的字体大小,和他们的旋转。
下面是一个例子:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
genreplot = pd.DataFrame(columns=['genres', 'pct'])
genreplot.genres = np.random.random_integers(1, 10, 20)
genreplot.pct = np.random.random_integers(1, 100, 20)
genreplot = genreplot.set_index(['genres'])
ax = genreplot.plot(kind='barh', width=1)
现在,你可以设置你的标签5
pct_labels = np.arange(0, 100, 5)
ax.set_xticks(pct_labels)
ax.set_xticklabels(pct_labels, rotation=45)
有关进一步的参考,你可以在this page看一看的文件上xticks
和yticks
: