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
1
vote
0 answers

label boxplot extreme points in julia using Plotly Backend

i'm plotting a boxplot using plotlyJS backend for Plots in Julia 0.6.2 And i'm trying to make it possible to show particular labels (strings) for the points that are extreme. (so we can identify them easily). check the image for further…
inarighas
  • 720
  • 5
  • 24
1
vote
0 answers

How to do two levels of grouping and coloring for boxplots in R

I have the following dataset (it can be loaded into an object named df using dget). structure(list(Group = c("ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko", "ko",…
rizude
  • 11
  • 1
1
vote
1 answer

How to call a bloxplot several times (elegantly)?

Sometimes, as in the following code, I call the same boxplot several times. x <- 1:10 y <- 1:5 r <- boxplot(x, y,col="blue") grid(nx=NA, ny=NULL) #grid over boxplot par(new=TRUE) boxplot(x, y,col="blue")#grid behind boxplot In cases with many…
Clyde Frog
  • 483
  • 1
  • 6
  • 15
1
vote
2 answers

R programming - ggplot2 boxplot labeling by group issue

Currently I have a data frame where I want to plot three variables into one boxplot: livingsetting factor outcome 1 1 CKD 2 2 1 CKD 13 3…
Luiance
  • 11
  • 6
1
vote
1 answer

ggplot - adding labels to a box plot created from pre-computed values

given a dataframe df like below. df <- data.frame(x=c("A","B"), min=c(1,2), low=c(2,3), mid=c(3,4), top=c(4,5), max=c(5,6)) Using ggplot, one can create a box plot like below library(ggplot2) ggplot(df, aes(x=x, ymin = min, lower = low, middle =…
user3206440
  • 4,749
  • 15
  • 75
  • 132
1
vote
2 answers

How to print frequency on boxplot - ggplot - R

This is my Dataframe X color cut carrat 1 E Ideal 0.23 2 J Premiun 0.34 3 E Ideal 0.23 ... I want to create a box plot of my column var "cut". Here is the code for what I want to do... ggplot(diamonds, aes(cut)) +…
fiticida
  • 664
  • 1
  • 10
  • 24
1
vote
1 answer

How to display the boxplot with more than 2 decimal places in ggplotly

I have to use ggplotly for my boxplot, but it only displays 2 decimal places. So a lot of my values will show 0.00 in the plot. As you can see in the example from plotly's website https://plot.ly/ggplot2/box-plots/ , only display 2 decimal. If I…
Peter Rowan
  • 127
  • 1
  • 11
1
vote
2 answers

Legend customization for boxplots

I have this boxplots graph, and then I am trying to plot 2 different points on top of it, of different colors, so that the user can see where they fall on the boxplot, plus compare them to each other. The problem is, i want the legend to show two…
JustLearning
  • 180
  • 2
  • 12
1
vote
1 answer

How to add a single legend label for a set of boxplots?

Is there a better way of adding a single label to a legend for a set of boxplots? Below is a simple worked example that gives the desired result. This is done my creating an invisible line (alpha=0) with the desired label, then changing the alpha…
tsherwen
  • 1,076
  • 16
  • 21
1
vote
1 answer

Grouping by another variable - boxplots in ggplot2

I am trying to create a boxplot where I can group one variable by the levels of a second variable. I have worked out how to facet wrap, but how do I get all the bars on the same plot? I need to create the following: x-axis: Time period (TP) - 4…
Skyblue
  • 11
  • 2
1
vote
1 answer

Python Dataframe boxplot, wisker caluclation with outliers

I was curious at how pandas dataframe handles calculating the upper and lower whiskers, with outliers. Normally it's 1.5IQR-Q1, 1.5IQR+Q3. However, the problem I can't understand, or maybe I'm wrong on how the whiskers are calculated. It shows the…
1
vote
1 answer

How to customize a boxplot legend indicating mean, outliers, median, etc?

I have a boxplot and by my supervisor's advice I have to indicate the mean, outliers and median in the legend, like this image: How can I do this using ggplot2? library(ggplot2) A <- 1:20 DF <- data.frame(A) ggplot(data = DF) + …
Daniel Valencia C.
  • 2,159
  • 2
  • 19
  • 38
1
vote
1 answer

changing outlier rule from IQR to standard devations in geom_boxplot

I know the default setting for geom_boxplot() is: Q3 + 1.5 * IQR Q1 - 1.5 * IQR but I wanted to do 4 standard deviations from the mean: MEAN + 4 * SD MEAN - 4 * SD Is this possible to do in ggplot2? If not, what is the alternative? I saw a…
Sheila
  • 2,438
  • 7
  • 28
  • 37
1
vote
1 answer

Is there a way to combine 2 boxplots into 1?

The code I have so far gives me 2 boxplots, but I was just wondering if there is a way to combine these 2 boxplots into one (By combining "Type_1"and "Type_2). poke = read.csv("pokemon_2018.csv",TRUE,",") par(mfrow =…
stanley cho
  • 143
  • 1
  • 1
  • 6
1
vote
0 answers

Removing outliers from facet_wrap boxplots in ggplot

How can I change the y axis to exclude outliers (not just hide them but scale the y axis so as not to include them) for geom_boxplot with multiple individual boxplots using facet_wrap? An example of my dataset is: Pop. grp1 grp2 grp3 grp4 …
CWills
  • 11
  • 2