使用seaborn检索1个特定的斧头及其组件

我想在使用 seaborn 时取回 1 个特定的斧头:我这样做:

g = sn.pairplot(df.iloc[:, iloc_col], kind='hist')

所以我得到了一个带有很多轴的无花果(参见https://seaborn.pydata.org/ generated/ seaborn.pairplot.html)并且我想单独访问每个轴,我该怎么办?谢谢,


牛魔王的故事
浏览 40回答 1
1回答

呼啦一阵风

您可以使用以下方法访问子图的二维数组g.axes:penguins = sns.load_dataset('penguins')g = sns.pairplot(penguins, hue="species")# access the lower left axes:ax = g.axes[-1,0]ax.annotate('A', xy=(0.5,0.5), xycoords='axes fraction',             fontsize=100, weight='bold', color='red', ha='center', va='center')
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python