Questions for seaborn.catplot
Questions tagged [catplot]
80 questions
1
vote
0 answers
How do I change the font size of the legend in a seaborn catplot
I am trying to increase the font size of the legend of a catplot.
The data:
Status SameDay Pickup point Trip Completed
0 False Airport 60
1 False City 38
2 True Airport 1267
3 True City 1466
My…

Vatsal
- 33
- 3
1
vote
1 answer
How to rotate the titles in a FacetGrid
How can I change the rotation of the titles in each Facet (subplot) of a seaborn figure-level plot.
I would like to rotate label at the top by 90 degrees, and remove label at the bottom.
import seaborn as sns
sns.set_theme(style="whitegrid")
df =…

DAMIEN
- 17
- 3
1
vote
1 answer
Sort seaborn catplot by value counts within each facet
I am close but not quite there. I am trying to sort an sns.catplot by value counts within each grouping.
Code and Output:
fig = plt.subplots(dpi=300)
plt.figure(figsize=(10, 10))
grid = sns.catplot(data=df, kind='count', y='violation_raw',…

MarkS
- 1,455
- 2
- 21
- 36
1
vote
1 answer
How to set bar widths equal in catplot with horizontal bars
I have a data that I want to present as horizontal bar plots in rows and columns. I'm trying to do this with Python seaborn, which facet facility suits this purpose well.
The set of y-axis variables is different on the row dimension, and I don't…

Antti
- 1,263
- 2
- 16
- 28
1
vote
1 answer
subplotting with catplot
Good morning,
I have a small problem with subplotting using bar catplot of seaborn
here is a small example to illustrate:
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
y = [1.0, 5.5, 2.2, 9.8]
x = ["A", "B", "A", "B"]
z…

Josh.h
- 71
- 1
- 13
1
vote
1 answer
Seaborn Catplot takes 10 minutes to complete
I am implementing a seaborn (Version 0.11.1) catplot in Jupyter Notebook (Python 3.8).
The dataframe generated is generated by following code
city_lit_rate_long=city_lit_rate[{'Male Literacy','Female Literacy',
…

geoabram
- 125
- 2
- 11
1
vote
1 answer
Replace Bool with yes/no in the bar label for catplot of kind='count'
I have a graph I made in Seaborn (catplot type=count) and I am trying to make it look a bit nicer by replacing True and False with Yes and No.
this is the code so far:
g_q1 = sns.catplot(x='Q1', kind='count', order=[True, False], data=clean_df,…

Jannik
- 13
- 2
1
vote
1 answer
Set color for specific bar in catplot
For the code below I am trying to create a barplot. If the column name in column ACQUISITION_CHANNEL = 'Referral' then the bar should be red else grey.
g = sns.catplot(
data=df, kind="bar",
x="CITY", y="CUSTOMERS",…

user12625679
- 676
- 8
- 23
1
vote
1 answer
Seaborn Catplot similar to Pandas groupby
I am working with the Portuguese Bank Marketing dataset
http://archive.ics.uci.edu/ml/datasets/Bank+Marketing#
I would like to visualise the conversion rate per some categorical feature e.g. occupation or marital status.
Using pandas groupby() as…

Michal B.
- 111
- 1
- 12
1
vote
2 answers
how to overlay two sns.catplots
I need to overlay two sns.catplots
One is of kind='box' and the other is kind='swarm' as follows:
gbox= sns.catplot( x="Emotion",y="Threshold",hue="Group", col = 'Task',
data=indata,palette ["skyblue","salmon"], kind="box",…

user14480254
- 19
- 2
1
vote
1 answer
How to filter pandas dataframe based on hue and col categories in seaborn catplot?
I am not able to take (let say) top 10 categories of my feature in hue as well as col parameter using catplot graph in seaborn.
def categorical_plot(data , feature1 , feature2 , col_feature ,hue_feature , plot_type):
plt.figure(figsize =…

loving_guy
- 381
- 4
- 15
1
vote
1 answer
Seaborn Catplot is throwing error: truth value is ambiguous
I am trying to do a catplot using seaborn library for all the categorical variables in my dataframe but I ma getting error for ambiguous truth value. It generally happens with "&" value but I am unable to get the root cause here. My target is…

dg S
- 85
- 3
- 9
1
vote
1 answer
How to control the axes of individual subplots in catplot
Consider the following data:
df = pd.DataFrame([['green','tree',2],
['green','leaf',3],
['red','tomato',1],
['red','pepper',5],
['red','apple', 1]], columns=['color',…

Ziofil
- 1,815
- 1
- 20
- 30
1
vote
0 answers
Vary the color intensity of bars per category of a seaborn 'catplot' based on y-axis value of the bar
For a single or a stacked barplot I can vary the color intensity based on the value by using sns.color_palette("Blues", len(df['x'])) (it has its own issue that equivalent bars still have different colors, but thats a question for later). It looks…

jar
- 2,646
- 1
- 22
- 47
0
votes
1 answer
catplot doesn´t display bars while importing a csv
I have made my own code trying to find any differences but I don´t know where is the trick, here is one catplot that display well:
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
# Change the color palette to "RdBu"
par_ad…

Manuel Veiga
- 35
- 4