boxplot

Creating circular boxplot for circadian data

Creating circular boxplot for circadian data Question: I am trying to find an R code to make a plot that looks like this (below). I know this figure was created in python because I emailed the person who created this code but after 2 months of back and forth with him promising to get me …

Total answers: 1

Python categorical variables NaN while creating box-plot

Python categorical variables NaN while creating box-plot Question: After I successfully created categorical values, their result is NaN. I used this command: df[‘Memory’]= pd.cut(pd.to_numeric(df[‘RAM ‘], errors="coerce"), [0,4,8,12], include_lowest=True, labels=[‘Basic’, ‘Intermediate’, ‘Advaced’]) After running df.head() here’s the table: When I try to box-plot them: sns.boxplot(x=’Memory’, y=’Price’, data=df[‘RAM ‘] = pd.to_numeric(df[‘RAM ‘], errors="coerce") ; df[‘Memory’]= pd.cut(df[‘RAM ‘], …

Total answers: 1

Python boxplot make wider

Widen Python boxplot Question: I’m new to Python and I have problem with box-plot size. I need to show the brand of phones and their batteries. However, the box-plot is not wide enough to show names of all brands. I would like do it with this command: import seaborn as sns sns.boxplot(x=’Brand’, y=’BatteryCapacity’, data=df) Is …

Total answers: 1

Rotate Label Axis X in a specific subplot using sns.boxplot (seaborn)

Rotate xtick labels of a specific subplot Question: How to rotate in 90° the labels of X axis of subplot 222 (chart 2) and keep using sns.boxplot? fig = plt.figure(figsize=(12, 8)) # CHART 1 fig.add_subplot(221) #sns.countplot(df_train[‘MSZoning’]) sns.boxplot(x=’MSZoning’, y=’SalePrice’, data=df_train) # CHART 2 fig.add_subplot(222) #sns.boxplot(x=’MSZoning’, y=’SalePrice’, data=df_train) sns.boxplot(x=’Neighborhood’, y=’SalePrice’, data=df_train) # CHART 3 fig.add_subplot(223) #sns.boxplot(x=’Neighborhood’, y=’SalePrice’, …

Total answers: 1

Make boxplots side by side instead of overlap

Make boxplots side by side instead of overlap Question: I want to make boxplots using data from two files. I can use code below for one of them: import matplotlib.pyplot as plt import pandas as pd df1 = pd.read_csv("file1", sep=r’s+’, header=0) df1.boxplot([‘VAL’], by=[‘LABEL’]) I tried to use code below for combining two dataset on one …

Total answers: 1

Adding hatch to Seaborn multi-boxplot

Adding hatch to Seaborn multi-boxplot Question: In the chart below, I want to add hatch (‘/’) only to the ‘rest’ category in both boxlots. I will be glad if you help I add the sample codes below: import seaborn as sns exercise = sns.load_dataset("exercise") df1=exercise.loc[(exercise["diet"]=="low fat"),:] df2=exercise.loc[(exercise["diet"]=="no fat"),:] fig, axes = plt.subplots(1, 2) ax1=sns.boxplot(x=’kind’, y=’pulse’, …

Total answers: 1

Highlight a single point in a boxplot in Plotly

Highlight a single point in a boxplot in Plotly Question: I have a boxplot in Plotly. I would like to overlay a single point on some of the boxes. I thought I could do this by adding a scatter trace to the fig, but when I look into the data of the figure I can’t …

Total answers: 1

Multiple boxplots on the same graph

Multiple boxplots on the same graph Question: I need to create multiple boxplots on the same graph. The sports are 3. I need to obtain 3 boxplots on the same graph of each sport, with a specific variable on the y-axis. I need to be able to change the variable. The variable for each student …

Total answers: 1

Generate a subplot with ylim in df.boxplot()

Generate a subplot with ylim in df.boxplot() Question: I have the following code: df.boxplot(column = [‘rate’], by = ‘age’, figsize=(9,7)) However, this boxplot has an outlier that shows really small the boxes. I need to code the following: #1st Subplot df.boxplot(column = [‘rate’], by = ‘age’, figsize=(9,7)) #2nd Subplot df.boxplot(column = [‘rate’], by = ‘age’, …

Total answers: 1

Rotate the xlabels with seaborn

Rotate the xlabels with seaborn Question: I’ve made a boxplot, but as you see the xlabels are too long so I need to rotate them a little bit: I’ve found several topics for this, here on stack, and on other sites. Some of my tries and the errors I got: long_box.set_xticklabels(long_box.get_xticklabels(),rotation=30) or plt.setp(long_box.get_xticklabels(), rotation=45) give …

Total answers: 1