facet-grid

Plot multiple distplot in seaborn Facetgrid

Plot multiple distplot in seaborn Facetgrid Question: I have a dataframe which looks like below: df: RY MAJ_CAT Value 2016 Cause Unknown 0.00227 2016 Vegetation 0.04217 2016 Vegetation 0.04393 2016 Vegetation 0.07878 2016 Defective Equip 0.00137 2018 Cause Unknown 0.00484 2018 Defective Equip 0.01546 2020 Defective Equip 0.05169 2020 Defective Equip 0.00515 2020 Cause Unknown …

Total answers: 1

How to change the catplot bar positions

How to change the catplot bar positions Question: I’m having trouble with the location of the bars on the scale. I understand it to be that some of the hue amounts are 0, so this is throwing off the position of the bars. In the image, the top right plot shows the green and brown …

Total answers: 1

Seaborn FacetGrid Plot with Multiple Y-Axis Ranges

Seaborn FacetGrid Plot with Multiple Y-Axis Ranges Question: How do i change the single y axis interval for every plot for Seaborn’s FacetGrid Plot? If I plot a facetGrid that contains a lot of variable y values, Seaborn uses the default min and max y values of all the data to construct the only y-axis. …

Total answers: 1

Seaborn Facet Grid: Adding horizontal Mean line to each plt.plot facet

How to add a horizontal mean line and annotation to each facet Question: I have a simple FacetGrid of 2 row and 1 column with lineplots denoting different categories for the facets – image below. # lineplot for each Category over the last three years g = sns.FacetGrid(df, row="Category", sharey=False, sharex=False, height=2.5, aspect = 3) …

Total answers: 2

Prevent Sharing of Y Axes in a relplot

Prevent Sharing of Y Axes in a relplot Question: 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 …

Total answers: 1

Draw a line at specific position/annotate a Facetgrid in seaborn

Draw a line at specific position/annotate a Facetgrid in seaborn Question: A have produced a boxplot with Facetgrid in seaborn the following way # Import the dataset tips = sns.load_dataset("tips") # Plot using FacetGrid, separated by smoke plt.style.use(‘ggplot’) g = sns.FacetGrid(tips, col="smoker", size=5, aspect=1.5) g.map(sns.boxplot, "sex", "total_bill", palette=’viridis’, order=[‘Male’, ‘Female’]) plt.show() I now want to …

Total answers: 5

How to increase the font size of the FactorPlot/FacetGrid legend

How to increase the font size of the FactorPlot/FacetGrid legend Question: The instructions from this question don’t work for Seaborn FacetPlots. Would it be possible to get the method to do the same? Asked By: tangy || Source Answers: As in the linked answer you may use setp to set the properties (in this case …

Total answers: 3

Overlay a line function on a scatter plot – seaborn

Overlay a line function on a scatter plot Question: My challenge is to overlay a custom line function graph over a scatter plot I already have, the code looks like follows: base_beta = results.params X_plot = np.linspace(0,1,400) g = sns.FacetGrid(data, size = 6) g = g.map(plt.scatter, “usable_area”, “price”, edgecolor=”w”) Where base_beta is only a constant, …

Total answers: 3