我已经对数据进行分箱以绘制直方图。因此,我正在使用该plt.bar()功能。我想将绘图中的两个轴都设置为对数刻度。
plt.bar()
如果设置plt.bar(x, y, width=10, color='b', log=True),则可以将y轴设置为log,但不能设置x轴为对数。plt.xscale('log')不幸的是,我尝试了这种方法。x轴刻度消失,条形的大小没有相等的宽度。
plt.bar(x, y, width=10, color='b', log=True)
plt.xscale('log')
我将不胜感激。
python matplotlib bar-chart loglog
bar-chart ×1
loglog ×1
matplotlib ×1
python ×1