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
1 answer

R: ggplot2 plotting 1 combined boxplot instead of 2 plots for 2 categories

This is probably a simple problem with a simple fix, but I cannot seem to get it right for some reason. I am trying to plot a continuous variable "cnt" against a categorical variable "yr" with 2 categories (1 or 2). The data is roughly split in half…
stats_nerd
  • 233
  • 1
  • 12
1
vote
1 answer

Extended Highcharts Boxplot to include mean line - how to remove extra line on resize?

I've extended the 'drawPoints' prototype in order to add a mean line to the boxplot, following the docs and this fiddle. (function (H) { H.seriesTypes.boxplot.prototype.pointArrayMap = ['low', 'q1', 'median', 'q3', 'high', 'mean']; …
1
vote
1 answer

Partly change outliner styles in boxplot

Suppose I have the following data set data <- c( 9.5, 27.9, 7.8, 17.8, 31.4, 25.9, 27.4, 25.2, 31.1, 34.7, 42, 29.1, 32.5, 30.3, 33, 33.8, 41.1, 34.5, 62) When I drew the boxplot in r boxplot(data) I got three outliers 7.8, 9.5, and 62, that…
Likan Zhan
  • 1,056
  • 6
  • 14
1
vote
1 answer

How to remove group info on x axis label

If I plot normally with ggplot, I will have x axis labels in order (figure 1). I don't want the alphabetical order, so I use interaction. The plot looks as expected, but there is too much information to show on x axis (figure 2). Is there other…
Peter Rowan
  • 127
  • 1
  • 11
1
vote
3 answers

Box Plot in Shiny R

I am trying to create/ learn an interactive box plot through Shiny, below id the code i m trying to use. This gives me the error Warning: Error in model.frame.default: variable lengths differ (found for 'input$p') [No stack trace available] I…
Fahadakbar
  • 488
  • 1
  • 8
  • 26
1
vote
1 answer

Boxplots within violin plot with faceting and fill R

I am trying to create violin plots with boxplots within each violin plot. Currently, the boxplots are being created based on the x variable while combining the fill grouping. I would for there to be a boxplot for each of the fill groups at each of…
1
vote
1 answer

d3 js boxplot with log scale

I'm here referring to this reproducible example http://bl.ocks.org/jensgrubert/7789216 but applied to the following dataset…
maxbre
  • 161
  • 9
1
vote
2 answers

ggplot geom_point position_jitterdodge not working when color specified?

I have plotted a boxplot+points. I want to add colors to the points. The position_jitterdodge worked fine without color as shown in Figure B, the points are close, which is I intended to do. But when I try to add colors to the points, the…
Bing
  • 1,083
  • 1
  • 10
  • 20
1
vote
2 answers

Q: Display grouped and combined boxplot in a single plot in R

I am trying to display grouped boxplot and combined boxplot into one plot. Take the iris data for instance: data(iris) p1 <- ggplot(iris, aes(x=Species, y=Sepal.Length)) + geom_boxplot() p1 I am trying to compare overall distribution with…
Charlie_C
  • 13
  • 4
1
vote
0 answers

groupby boxplot with date positions on xaxis

there is something missing in my understanding of groupby.boxplot(). I have a dataFrame DF with dates' andvalues` like below : dates values 0 2016-10-20 18:19:15 20.8 1 2016-10-20 18:20:15 21.1 2 2016-10-20…
user3046026
  • 149
  • 1
  • 14
1
vote
1 answer

Grouped boxplot with 2 y axes, 2 plotted variables per x tick

I am trying to make a boxplot of an 18 year record of monthly rainfall and flood frequency. i.e. each x tick is the month, and each x tick is associated with two boxplots, one of the rainfall and one of the flood frequency. So far I have managed to…
SHV_la
  • 875
  • 1
  • 10
  • 14
1
vote
1 answer

how to create a proper geom_boxplot?

I am trying to create a regular boxplot chart, but am getting a weird dotted chart instead. Could you please point out to me what I am doing wrong and how I can correct it? Thank you very much. box_plot <- comb_rpt %>%…
bispire
  • 35
  • 2
1
vote
2 answers

How can I use jitter horizontally on boxplot outliers?

I tried the following method from Outliers for boxplot and it worked well for me: bar <- boxplot(foo,plot=FALSE) boxplot(foo,outline=FALSE,ylim=c(min(c(bar$stats,bar$out)),max(c(bar$stats,bar$out)))) points(jitter(rep(1, length(bar$out))),…
G-Rex
1
vote
2 answers

Building Boxplots with ggplot2

I am trying to reproduce a boxplot with some given data. One variable is Energy Consumption and the other one is number of republican voters or democrat voters. I'm trying to get a boxplot to compare the median energy consumption of republicans vs…
1
vote
1 answer

How can I create a boxplot of within-group euclidian distances for grouped data?

Example data: set.seed(1234) a <- matrix(rnorm(250),nrow=25,ncol=10) fac <- as.factor(c(rep("A",8),rep("B",10),rep("C",7))) a.dist <- dist(a, "euclidian") boxplot(a.dist ~ fac) When I try to run boxplot(a.dist ~ fac), I get the following…
Antsushi
  • 167
  • 10