Reputation: 7440
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'
Upvotes: 4
Views: 7956
Reputation: 339590
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()
Upvotes: 8