Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Individual axes limits for pairplot in python

Tags:

python

seaborn

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

like image 956
Austin Cooper Avatar asked Jul 11 '18 17:07

Austin Cooper


1 Answers

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))
like image 120
ImportanceOfBeingErnest Avatar answered Sep 28 '22 07:09

ImportanceOfBeingErnest