我在matplotlib中有一个堆叠条形图,除了在绘图中看不到XTick之外,该条形图很好
fig, axes = plt.subplots(6, 1, sharex=True, figsize=(20, 10), subplot_kw=dict(frameon=True))
n = 6
i=0
for lineage, j in zip(['a', 'b', 'c', 'd', 'e', 'f'], axes.flatten()):
x=list(map(lambda x: int(x.strip()[1:-1]), lineage_snp[lineage].value_counts().index))
y=list(lineage_snp[lineage].value_counts().values/lin_counts[lineage])
j.bar(x, y, label = lineage, alpha=1, width=100, color = colors[lineage])
j.legend(loc = 'upper left')
j.grid(True)
plt.subplots_adjust(hspace=.0)
i+=1
plt.xticks(rotation=0)
plt.show()
我错过了什么?如果我保持网格打开,我可以得到勾号所在的网格,但我更希望网格关闭,并且标签上只显示一个勾号
我明白了。我使用的是
seaborn-whitegrid
样式,在更改为seaborn-ticks
时,滴答声很好相关问题 更多 >
编程相关推荐