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 …

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 ‘], …

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 …

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’, …

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 …

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’, …

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 …

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 …