我正在尝试在 Seaborn 网格中获取 hexbin 图。我有以下代码,
# Works in Jupyter with Python 2 Kernel.
%matplotlib inline
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
tips = sns.load_dataset("tips")
# Borrowed from http://stackoverflow.com/a/31385996/4099925
def hexbin(x, y, color, **kwargs):
cmap = sns.light_palette(color, as_cmap=True)
plt.hexbin(x, y, gridsize=15, cmap=cmap, extent=[min(x), max(x), min(y), max(y)], **kwargs)
g = sns.PairGrid(tips, hue='sex')
g.map_diag(plt.hist)
g.map_lower(sns.stripplot, jitter=True, alpha=0.5)
g.map_upper(hexbin)
However, that gives me the following image,
![seaborn output](https://i.stack.imgur.com/lB5wa.png)
如何修复六边形图,使其覆盖图形的整个表面,而不仅仅是显示的绘图区域的子集?