Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Sharing of Y Axes in Seaborn Relplot

I'm having trouble getting seaborn's relplot function to plot with different y axes on each row (while sharing x axes per column).

I can see that both the FacetGrid and catplot methods in seaborn have a sharex/sharey keyword argument that would solve my problem, but I can't find a similar one in relplot.

Is there some way I can work around this if it's intended by accessing the subplots returned by relplot individually? I would like to continue using relplot as it handles figure sizing perfectly while FacetGrid has a lot of issues in that area. Thanks.

like image 622
Sooraj Achar Avatar asked May 29 '19 15:05

Sooraj Achar


People also ask

How do I get rid of the y axis in Seaborn?

To remove X or Y labels from a Seaborn heatmap, we can use yticklabel=False.

What is Col_wrap?

col_wrapint. “Wrap” the column variable at this width, so that the column facets span multiple rows. Incompatible with a row facet. share{x,y}bool, 'col', or 'row' optional. If true, the facets will share y axes across columns and/or x axes across rows.

What is rel plot?

The Seaborn Relational Plot (relplot) allows us to visualise how variables within a dataset relate to each other. Data visualisation is an essential part of any data analysis or machine learning workflow. It allows to gain insights about our data.


1 Answers

This can be done by passing a dictionary with FacetGrid keyword arguments to relplot, like this:

facet_kws={'sharey': False, 'sharex': True}

(See seaborn.relplot documentation.)

like image 127
blizzard Avatar answered Oct 17 '22 02:10

blizzard