inner() got multiple values for argument 'ax'

送分小仙女□ 提交于 2020-01-05 08:35:09

问题


In a Jupyter notebook with Python I am plotting a hexbin jointplot from two columns of a dataframe. The plot is correctly plotted but I cant manage to resize the picture.

Here is the code:

fig, ax = plt.subplots()
fig.set_size_inches(11.7, 8.27)
sns.jointplot(x=train['max1'], y=train['intangle'], kind="hex", color="#4CB391",ax=ax)
plt.show()

gut I get inner() got multiple values for argument 'ax'


回答1:


The issue is that jointplot creates its own figure and axes. It therefore does not have an ax argument available. Also the size of the figure is always squared. To change the size, use the size argument.

sns.jointplot(..., size=10)
plt.show()

Or, change the figure size afterwards,

g = sns.jointplot(...)
g.fig.set_size_inches(11,6)
plt.show()


来源:https://stackoverflow.com/questions/47029479/inner-got-multiple-values-for-argument-ax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!