我的代码是:
figure1, axes = plt.subplots(2, 1, figsize=(10, 12))
#figure1.tight_layout(pad=4.0)
#Bar plot (Frequency vs Source) for Inflow
#sns.barplot(x="Pageviews", y="Source", data=top_15_src, ax=axes[0])
sns.barplot(y="Source", x="Pageviews", data=top_15_src,ax=axes[0])
axes[0].set_title('Number of clicks from each source')
axes[0].set_xlabel('Pageviews')
axes[0].set_ylabel('Source')
axes[0] = plt.gca()
#Bar plot (Frequency vs Destination) for Outflow
sns.barplot(x="Pageviews", y="Destination", data=top_15_dest, ax=axes[1])
#sns.factorplot(y="Destination", x="Pageviews", kind='bar', data=top_15_dest, label="Total", ax = axes[1])
axes[1].set_title('Number of clicks to each destination')
axes[1].set_xlabel('Pageviews'); axes[1].set_ylabel('Destination')
由于子图,轴是 NumPy 数组。我只想从第一个图中删除科学记数法。我试过这种方法:
axes[0].get_xaxis().get_major_formatter().set_scientific(False)
但指数形式(科学记数法)仍然存在。这是地块的图片。