Skip to main content

All Questions

1 vote
1 answer
45 views

How to add legend of plotted line in a box plot?

I have plotted a set of data in a boxplot, and I have added a line in the plot. I want to have the labels of the median and mean in the legend, and I have got it. However, I'm also trying to add the ...
lolloa's user avatar
  • 27
1 vote
1 answer
42 views

Legend for boxplot graph layers

I've made this boxplot graph # Tamanho do gráfico em polegadas plt.figure(figsize=(11, 6)) # Gráfico ax = sns.boxplot(x="CÓD. ESTAÇÃO", y ="FERRO", data=df_FERRO, linewidth=1.0, ...
gongmaodu's user avatar
0 votes
0 answers
366 views

Seaborn boxplot legend ignoring colors [duplicate]

I have a boxplot in Seaborn/Matplotlib for multiple categorical data: The problem is the legend part does not match with the plot color. data = pd.DataFrame.from_dict(data) print(data.head()) ...
m0ss's user avatar
  • 432
1 vote
1 answer
1k views

Issue with Seaborn Box Plot Legend

I plotted a Box plot using seaborn. import seaborn as sns sns.set(rc={'figure.figsize':(4,10)}) sns.set_theme(style="whitegrid") plt.rcParams["font.family"] = "Calibri" ...
Prateek Sinha's user avatar
1 vote
1 answer
1k views

Seaborn legend modification for multiple overlapping plots

I am trying to create a seaborn boxplot and overlay with individual data points using seaborn swarmplot for a dataset that has two categorical variables (Nameplate Capacity and Scenario) and one ...
pandi20's user avatar
  • 11
3 votes
1 answer
21k views

Adding a legend to a boxplot in matplotlib/seaborn

I am new to Python. I have generated a boxplot (with a swarmplot overlay) in matplotlib/seaborn using the following code. I would now like to add a legend that follows the color scheme of each box. ...
Christer Edvardsson's user avatar
2 votes
1 answer
3k views

Creating a key for box plot mean and median lines in Matplotlib

I have the following code which creates a box plot of APOE4 gene copies and memory scores (hence the variable names) clean_merged.boxplot('composite scores', by='APOE4', widths = 0.8, showmeans = ...
Finn Hull's user avatar
0 votes
1 answer
3k views

Adding a label to pandas dataframe boxplot?

I've got a dataframe with a column titled label containing 4 unique text values of which are categorical in nature e.g Kitchen Appliances, Electronics, Women's Fashion, Stationary. Now, with the code ...
clover's user avatar
  • 331
5 votes
1 answer
7k views

Adding a legend to a Pandas DataFrame boxplot

I am plotting a series of boxplots on the same axes and want to adda legend to identify them. Very simplified, my script looks like this: import pandas as pd import matplotlib.pyplot as plt import ...
doctorer's user avatar
  • 1,752
2 votes
1 answer
8k views

seaborn pointplot and boxplot in one plot but shifted on the x-axis

I want to plot both a boxplot and the mean in one figure. So far my plot looks like this using these lines of code: sns.swarmplot(x="stimulus", y="data", data=spi_num.astype(np.float), edgecolor="...
Svenno Nito's user avatar