Questions for seaborn.catplot
Questions tagged [catplot]
80 questions
43
votes
5 answers
Draw a line at specific position/annotate a Facetgrid in seaborn
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,…

BCArg
- 2,094
- 2
- 19
- 37
18
votes
3 answers
How can I add grid lines to a catplot in seaborn?
How can I add grid lines (vertically and horizontally) to a seaborn catplot? I found a possibility to do that on a boxplot, but I have multiple facets and therefore need a catplot instead. And in contrast to this other answer, catplot does not allow…

Revan
- 2,072
- 4
- 26
- 42
18
votes
8 answers
Changing width of bars created with catplot or barplot
I'm trying to create bar chart using seaborn.factorplot. My code looks like this:
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv('data.csv')
fg = sns.factorplot(x='vesselID', y='dur_min', hue='route', size=6, aspect=2,…

kaleshanagineni
- 325
- 1
- 4
- 13
12
votes
2 answers
Remove some xtick labels from a seaborn plot
In the screenshot below, all my x-labels are overlapping each other.
g = sns.factorplot(x='Age', y='PassengerId', hue='Survived', col='Sex', kind='strip', data=train);
I know that I can remove all the labels by calling g.set(xticks=[]), but is…

Huey
- 2,714
- 6
- 28
- 34
9
votes
2 answers
How to rotate xticklabels in a seaborn catplot
I'm not able to rotate my xlabels in Seaborn/Matplotlib. I have tried many different solutions but not able to fix it. I have seen many related questions here on stackoverflow, but they have not worked for me.
My current plot looks like this, but I…

Cmagelssen
- 620
- 5
- 21
9
votes
2 answers
How to change the number or rows and columns in my catplot
I have a dataframe that looks like this:
with several different model_names's.
I am trying to graph the data in a seaborn catplot using the following code:
sns.set(style="whitegrid")
sns.catplot(x='model_name', y='score', hue='train_val_test',…

tshwizz
- 133
- 1
- 6
6
votes
1 answer
How to remove xticks from a catplot when there's no associated data
I have two queries:
I want to remove the empty bar from the bar graph (present in the first column).
I have to use this graph in a PowerPoint presentation. How can I increase the height of the bar graph such that it fixes the height of the slide? I…

Asra Khalid
- 177
- 1
- 18
5
votes
1 answer
How to rescale only one y-axis in seaborn catplot and add data labels
I have created a catplot for number of people killed/injured using the catplot function. However, since the scales of the 2 are very different the bars in second graphs are very small and cannot be read. Anyway I can re-scale y-axis of the second…

Raoul Fernandes
- 51
- 4
4
votes
1 answer
How to customize the text ticklabels for each subplot of a seaborn catplot
Let us consider the following example (from Seaborn documentation):
titanic = sns.load_dataset("titanic")
fg = sns.catplot(x="age", y="embark_town",
hue="sex", row="class",
…

MarcoS
- 13,386
- 7
- 42
- 63
4
votes
0 answers
Removing empty category when using seaborn.catplot
I have a data frame which is described as below:
dataset method score input_shape
0 A dataset method1 0.9 K=64
0 A dataset method2 0.9 K=64
0 A dataset method1 0.9 K=32
0 A dataset method2 …

John
- 41
- 3
4
votes
1 answer
Seaborn Catplot: Show line plot
The catplot function has an option called kind. It allows me to specify 'bar', 'point' etc. I am looking for a line plot. I am using catplot to show two categories side by side, using the same time scale,plotting sales from two different products.…

pythOnometrist
- 6,531
- 6
- 30
- 50
3
votes
2 answers
How to add hatches to boxplots with sns.boxplot or sns.catplot
I need to add hatches to a categorical box plot.
What I have is this:
What I need is something like this (with the median lines):
And what I have tried is this code:
exercise = sns.load_dataset("exercise")
g = sns.catplot(x="time", y="pulse",…

Nara Begnini
- 473
- 4
- 6
3
votes
1 answer
How can I display kind="swarm" and kind="point" on the same catplot in Seaborn?
I am trying to display both the means and errors (kind="point") and individual data points (kind="swarm") overlayed on the same catplot in Seaborn.
I have the following code:
sns.catplot(x="Variable_A", y="Dependent_Variable", col="Variable_B",…

cheekbonemagazine
- 33
- 3
3
votes
1 answer
Plot stacked barplot with seaborn catplot
I wonder is it possible to plot stacked bar plot with seaborn catplot.
For example:
import seaborn as sns
exercise = sns.load_dataset("exercise")
plot =…

Osca
- 1,588
- 2
- 20
- 41
2
votes
1 answer
How can I change the bar width in seaborn plots?
Each bar has large width
How can I reduce the width of bars, as shown by the drawn red rectangles?
I have the following code in Google Colab.
model_names = ['RFC', 'KNN', 'D-tree', 'SVM RBF']
accuracies = [0.999, 0.970, 0.997,…

MMH.SE
- 29
- 3