前后结果对比
修改前 | 修改后 |
---|---|
![]() | ![]() |
前后代码示例
修改前
ax = sns.jointplot(...)
plt.sca(ax.ax_joint)
plt.hist2d(...)
plt.colorbar(...)
修改后
ax = sns.jointplot(...)
plt.sca(ax.ax_joint)
plt.hist2d(...)
cbar_ax = ax.fig.add_axes(...)
plt.colorbar(cax=cbar_ax, ...)
关于 ax.fig.add_axes
的用法:Joint and marginal histograms