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
44
votes
2 answers

change thickness of the whole line geom_boxplot()

I would like to increase the boldness of the entire boxplot to be more visible on the hard copy. from Here seems "fatten" parameter change the thickness of the only median line. Is there any other parameter that control the thickness/width of the…
Areza
  • 5,623
  • 7
  • 48
  • 79
41
votes
3 answers

Turn off errorbars in seaborn plots

import seaborn as sns # sample data df = sns.load_dataset('titanic') ax = sns.barplot(data=df, x='class', y='age', hue='survived') Is there a way to turn off the black error bars?
equanimity
  • 2,371
  • 3
  • 29
  • 53
41
votes
1 answer

Add color to boxplot - "Continuous value supplied to discrete scale" error

There is probably a very easy solution to my problem but I couldn't find a satisfying answer online. Using the following command I was able to create the following boxplot graph and overlay it with the individual data points: ggplot(data = MYdata,…
Dalmuti71
  • 1,509
  • 3
  • 15
  • 19
40
votes
8 answers

Set no title for pandas boxplot (groupby)

When drawing a pandas boxplot, grouped by another column, pandas automatically adds a title to the plot, saying 'Boxplot grouped by....'. Is there a way to remove that? I tried using suptitle('') as per Pandas: boxplot of one column based on…
user308827
  • 21,227
  • 87
  • 254
  • 417
37
votes
2 answers

Add number of observations per group in boxplot

Following this question: How to add a number of observations per group and use group mean in ggplot2 boxplot?, I want to add number of observations per group in ggplot boxplot, too. But I have added a colour into aes mapping. The existing answer…
Bangyou
  • 9,462
  • 16
  • 62
  • 94
35
votes
3 answers

Changing whisker definition in geom_boxplot

I'm trying to use ggplot2 / geom_boxplot to produce a boxplot where the whiskers are defined as the 5 and 95th percentile instead of 0.25 - 1.5 IQR / 0.75 + IQR and outliers from those new whiskers are plotted as usual. I can see that the…
cswingle
  • 585
  • 1
  • 8
  • 13
34
votes
3 answers

Sorting a boxplot based on median value

I'd like to use R to make a series of boxplots which are sorted by median value. Suppose then I execute: boxplot(cost ~ type) This would give me some boxplots were cost is shown on the y axis and the type category is visible on the x-axis: ----- …
speciousfool
  • 2,620
  • 5
  • 28
  • 33
34
votes
5 answers

Boxplot in R showing the mean

Does anybody know of a way of generating a boxplot in R with a line (or another symbol) in the value corresponding to the mean? Thank you!
Brani
  • 6,454
  • 15
  • 46
  • 49
34
votes
1 answer

How to remove outliers in boxplot in R?

Possible Duplicate: Changing the outlier rule in a boxplot I need to visualize my result using box-plot. x<-rnorm(10000) boxplot(x,horizontal=TRUE,axes=FALSE) How can i filter outliers during visualisation? (1) So that i can have full image…
Manish
  • 3,341
  • 15
  • 52
  • 87
32
votes
2 answers

How to change order of boxplots when using ggplot2?

This question follows from this other one. I was unable to implement answers there. Define: df2 <- data.frame(variable=rep(c("vnu.shr","vph.shr"),each=10), value=seq(1:20)) Plot: require(ggplot2) qplot(variable,value,…
Fred
  • 1,833
  • 3
  • 24
  • 29
31
votes
3 answers

Changing data dynamically for a series in Highcharts

I have a chart working fine with data in the options, when I leave the data empty for a series and try the below (so I can change the data depending on a click) it doesn't work, any ideas? options.series[0].data =…
Staple
  • 712
  • 1
  • 10
  • 20
30
votes
2 answers

Finding the highest, lowest, total, average and median from an array in Ruby

I am creating a boxplot generator in Ruby, and I need to calculate some things. Let's say I have this array: arr = [1, 5, 7, 2, 53, 65, 24] How can I find the lowest value (1), highest value (65), total (157), average (22.43) and median (7) from…
user142019
28
votes
2 answers

How to draw the boxplot with significant level?

Some time ago I asked a question about drawing boxplot Link1. I have got some data with 3 different groups (or labels) Please down load here. I can use the following R codes to get the boxplot library(reshape2) library(ggplot2) morphData <-…
Samo Jerom
  • 2,361
  • 7
  • 32
  • 38
28
votes
4 answers

Is it possible to draw a boxplot given the percentile values instead of the original inputs?

From what I can see, boxplot() method expects a sequence of raw values (numbers) as input, from which it then computes percentiles to draw the boxplot(s). I would like to have a method by which I could pass in the percentiles and get the…
Alex Averbuch
  • 3,245
  • 5
  • 33
  • 44
27
votes
2 answers

Creating multiple boxplots on the same graph from a dictionary

I am trying to create a graph whereby the x axis is the key of the dictionary and the boxplot is from the information inside the dictionary. My dictionary can have many keys. Data = {'ABC': [34.54, 34.345, 34.761], 'DEF': [34.541, 34.748, 34.482]} …
Tom Pitts
  • 305
  • 1
  • 4
  • 6