我正在尝试使用matplotlib。在那里图中只有两个条形图,但它们之间的空间很大。我试图减少和增加宽度,但只是改变了条形图的宽度。你知道吗
def evaluate_bar_graph(coherences, indices):
assert len(coherences) == len(indices)
n = len(coherences)
x = np.arange(n)
plt.bar(x, coherences, width=0.1, tick_label=indices, align='center')
plt.xlabel('Models')
plt.ylabel('Coherence Value')
plt.show()
你可以用y位置选择你的条的位置,然后重命名x轴。 比如:
相关问题 更多 >
编程相关推荐