Individual axes limits for pairplot in python

自作多情 提交于 2020-08-27 09:28:18

问题


I'm fairly new to python and I'm trying to figure out how to set limits for individual axes for a pairplot. I know that using

pairplot.set(xlim=(0,100), ylim = (0,100))

will set all the axes in a pairplot to go from 0 to 100, but some of my variables range from 0 to 300000 while others range from 0 80. I'm trying to avoid the auto scale feature because I'm removing some data occasionally but want to keep the context of the original set.

I get something like below for example example


回答1:


You may access the axes of the PairGrid from its .axes attribute. For each of those axes you may set the limits as usual. E.g.

g = sns.pairplot(data)
g.axes[0,2].set_xlim((0,40))
g.axes[1,2].set_xlim((-20,20))


来源:https://stackoverflow.com/questions/51290828/individual-axes-limits-for-pairplot-in-python

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