Tick ​​check marks in Python seaborn package

I have a scatter plot matrix generated using the seaborn package, and I would like to remove all label marks, because they just mask the graph (either this or just delete them along the x axis) but I'm not sure how to do it and haven’t Google search success. Any suggestions?

 import seaborn as sns sns.pairplot(wheat[['area_planted', 'area_harvested', 'production', 'yield']]) plt.show() 

enter image description here

+7
python pandas ipython seaborn
source share
2 answers
 import seaborn as sns iris = sns.load_dataset("iris") g = sns.pairplot(iris) g.set(xticklabels=[]) 

enter image description here

+17
source share

You can use list comprehension to iterate over all columns and turn off xaxis visibility.

 df = pd.DataFrame(np.random.randn(1000, 2)) * 1e6 sns.pairplot(df) 

enter image description here

 plot = sns.pairplot(df) [plot.axes[len(df.columns) - 1][col].xaxis.set_visible(False) for col in range(len(df.columns))] plt.show() 

enter image description here

You can also rescale your data to something more readable:

 df /= 1e6 sns.pairplot(df) 

enter image description here

+4
source share

All Articles