Questions tagged [boxplot]

Boxplot is a form of displaying cardinally scaled data displaying robust summary statistics as graphical elements.

A boxplot (or a box-and-whisker plot) is a mean of displaying cardinally scaled data. The graphic displays robust summary statistics of a given dataset. These include for the box: the median, the lower quartile and the upper quartile. The enclosed whiskers are not commonly defined and may display some figure tied to the inter quartile range (e.g. IQR x 1.5) or the maxima/minima. Sometimes outliers are displayed as well.

Boxplots may easily be created by most statistical packages such as:

boxplot(rnorm(100)) #For R
boxplot(randn(100)) %For Matlab
graph box variable  'For Stata
boxplot(data)       #For matplotlib (python)
boxplot(dataframe)  #For seaborn (python)

Link:

3351 questions
23
votes
2 answers

is seaborn confidence interval computed correctly?

First, I must admit that my statistics knowledge is rusty at best: even when it was shining new, it's not a discipline I particularly liked, which means I had a hard time making sense of it. Nevertheless, I took a look at how the barplot graphs were…
anarcat
  • 5,605
  • 4
  • 32
  • 38
23
votes
2 answers

Plotting multiple boxplots in seaborn

I want to plot boxplots using seaborn in pandas because it is a nicer way to visualize data, but I am not too familiar with it. I have three dataframes that are different metrics, and I want to compare the different metrics. I will loop through the…
Jane Sully
  • 3,137
  • 10
  • 48
  • 87
23
votes
2 answers

Ordering boxplot x-axis in seaborn

My dataframe round_data looks like this: error username task_path 0 0.02 n49vq14uhvy93i5uw33tf7s1ei07vngozrzlsr6q6cnh8w... 39.png 1 0.10 …
amaatouq
  • 2,297
  • 5
  • 29
  • 50
23
votes
6 answers

Labeling Outliers of Boxplots in R

I have the code that creates a boxplot, using ggplot in R, I want to label my outliers with the year and Battle. Here is my code to create my boxplot require(ggplot2) ggplot(seabattle, aes(x=PortugesOutcome,y=RatioPort2Dutch ),xlim="OutCome",…
Deborah_Watson
  • 277
  • 1
  • 2
  • 8
23
votes
1 answer

R ggplot boxplot: change y-axis limit

I'm using ggplot to create sevral boxplots from the following data: df<-(structure(list(Effect2 = c("A2", "A2", "A2", "A2", "A2", "A2", "A2", "A2", "A2", "A2", "A2", "A2", "A2", "A2", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1", "A1",…
user2568648
  • 3,001
  • 8
  • 35
  • 52
23
votes
3 answers

boxplot using precalculated (summary) statistics

I need to do a boxplot (in Python and matplotlib) but I do not have the original "raw" data. What I have are precalculated values for max, min, mean, median and IQR (normal distribution) but still I'd like to do a boxplot. Of course plotting…
Nicke N
  • 233
  • 1
  • 2
  • 5
22
votes
1 answer

seaborn boxplot: Change color and shape of mean

Simple question that I cannot seem to find the answer to. How do I change the color and shape of the mean indicator in a Seaborn Boxplot? It defaults to a Green Triangle and it generally difficult to see. I've tried to find the answer in both the…
Christopher James
  • 312
  • 1
  • 3
  • 10
22
votes
2 answers

How to change x-axis tick label names, order and boxplot colour using R ggplot?

I have a folder containing csv files, each with two columns of data e.g.:…
user2639056
  • 295
  • 1
  • 5
  • 10
21
votes
3 answers

R: Plot multiple box plots using columns from data frame

I would like to plot an INDIVIDUAL box plot for each unrelated column in a data frame. I thought I was on the right track with boxplot.matrix from the sfsmsic package, but it seems to do the same as boxplot(as.matrix(plotdata) which is to plot…
gisol
  • 754
  • 3
  • 8
  • 20
20
votes
1 answer

Consistent width of boxplots if missing data by group?

I have a similar question previously discussed for barplots, but with missing solution for boxplots: Consistent width for geom_bar in the event of missing data I would like to produce a boxplots by groups. However, data for some groups can be…
maycca
  • 3,848
  • 5
  • 36
  • 67
20
votes
3 answers

How to plot a hybrid boxplot: half boxplot with jitter points on the other half?

I'm trying to make a similar plot to Fig. 2d-f in an article published on Nature this year. It's basically a half boxplot with points on the other half. Can anyone give me some hints? Thank you very much! These are my data and code which produced…
IloveCatRPython
  • 631
  • 8
  • 20
20
votes
1 answer

ValueError: num must be 1 <= num <= 2, not 3

I have the following dataframe that I generated using pivot_table: and I'm using the following code to boxplot the multiple columns: fig = plt.figure() for i in range(0,25): ax = plt.subplot(1,2,i+1) …
Patthebug
  • 4,647
  • 11
  • 50
  • 91
20
votes
3 answers

NA's are being plotted in boxplot ggplot2

I'm trying to plot a v. simple boxplot in ggplot2. I have species richness vs. landuse class. However, I have 2 NA's in my data. For some strange reason, they're being plotted, even when they're being understood as NA's by R. Any suggestion to…
R. Solar
  • 201
  • 1
  • 2
  • 3
20
votes
1 answer

Increase size of boxplot names in R

I'm having issues in locating an answer for this, as I don't want to increase the size of the x-axis label, but the names attribute of my boxplot. I am generating a 1x3 subplot, with 3 boxes shown within each boxplot. data1 = c(d1, d3, d3) data2 =…
erik
  • 3,810
  • 6
  • 32
  • 63
19
votes
2 answers

Combining plt.plot(x,y) with plt.boxplot()

I'm trying to combine a normal matplotlib.pyplot plt.plot(x,y) with variable y as a function of variable x with a boxplot. However, I only want a boxplot on certain (variable) locations of x but this does not seem to work in matplotlib?
ruben baetens
  • 2,806
  • 6
  • 25
  • 31