

Geom_point(data = df.outliers, aes(x = x.outliers, y = y.middle), size = 3, shape = 1) + # x-direction Geom_segment(aes(x = x.lower, y = y.max, xend = x.upper, yend = y.max)) + #upper end Geom_segment(aes(x = x.lower, y = y.min, xend = x.upper, yend = y.min)) + #lower end Geom_segment(aes(x = x.middle, y = y.min, xend = x.middle, yend = y.max)) + #whiskers # whiskers for y-axis dimension with ends Geom_segment(aes(x = x.max, y = y.lower, xend = x.max, yend = y.upper)) + #upper end Geom_segment(aes(x = x.min, y = y.lower, xend = x.min, yend = y.upper)) + #lower end Geom_segment(aes(x = x.min, y = y.middle, xend = x.max, yend = y.middle)) + #whiskers # whiskers for x-axis dimension with ends Geom_rect(aes(xmin = x.lower, xmax = x.upper, ymin = y.lower, ymax = y.upper), Geom_rect(aes(xmin = x.lower, xmax = x.upper, ymin = y.lower, ymax = y.upper), alpha = 0.3) +

# 2D box defined by the Q1 & Q3 values in each dimension, with outline

Putting it all together in one plot: ggplot(df, aes(fill = category, color = category)) + Select(category, x.middle, x.outliers, y.middle, y.outliers) %>%Ĭategory x.middle y.middle x.outliers y.outliers Create a separate data frame for outliers: df.outliers % Y.middle y.upper y.max y.outliers category X.min x.lower x.middle x.upper x.max x.outliers y.min y.lower Plot each dimension's boxplot separately: plot.x df You can calculate the relevant numbers required by each boxplot, & construct the 2-dimensional boxplots using different geoms.
