{
  "id": "visual-r5-07",
  "platform": "独立站",
  "author": "From Data to Viz",
  "author_url": "https://www.data-to-viz.com/",
  "url": "https://www.data-to-viz.com/caveat/boxplot.html",
  "title": "From Data to Viz · 同一批数据的箱线图盲区",
  "discovery_term": "原站 Caveats 里箱线图示例",
  "captured_at": "2026-12-05T02:00:56.424Z",
  "published_raw": null,
  "type": "page",
  "frames": [
    {
      "slide": 1,
      "path": "evidence/round-05/visual-r5-07/example-1.png",
      "caption": "箱线图标注结构",
      "observed": "anatomy of a boxplot: a diagram explaining how a boxplot is built"
    },
    {
      "slide": 2,
      "path": "evidence/round-05/visual-r5-07/example-2.png",
      "caption": "四种样本箱线摘要对照",
      "observed": "The Boxplot and its pitfalls – chart example"
    },
    {
      "slide": 3,
      "path": "evidence/round-05/visual-r5-07/example-3.png",
      "caption": "用散点显示组内原始数据",
      "observed": "The Boxplot and its pitfalls – chart example"
    }
  ],
  "observation": {
    "title": "The Boxplot and its pitfalls | Dataviz pitfall gallery",
    "url": "https://www.data-to-viz.com/caveat/boxplot.html",
    "headings": [
      "The Boxplot and its pitfalls",
      "Boxplot definition",
      "Boxplot: why?",
      "Alternative 1️⃣: Adding jitter",
      "Alternative 2️⃣: Switching to violin plot",
      "Alternative 3️⃣: Raincloud plot",
      "Going further",
      "Dataviz decision tree"
    ],
    "disclosure": [],
    "text": [
      "DATAVIZ CAVEAT",
      "The Boxplot and its pitfalls",
      "Boxplot definition",
      "A boxplot provides an effective summary of one or more numeric variables, showcasing key statistical features through its distinct elements:",
      "Median Line: The line that divides the box represents the median of the data. For example, if the median is 10, this indicates that half of the data points lie below 10 and half above.",
      "Quartiles: The ends of the box indicate the upper (Q3) and lower (Q1) quartiles. If Q3 is 15, this means that 75% of the observations fall below this value.",
      "Interquartile Range (IQR): The difference between Quartiles 1 and 3 is known as the interquartile range (IQR), which measures the spread of the middle 50% of the data.",
      "Whiskers: The lines extending from the box show the range of values within Q3 + 1.5 × IQR to Q1 - 1.5 × IQR, representing the highest and lowest values, excluding outliers.",
      "Outliers: Dots (or other markers) beyond the whiskers indicate potential outliers in the dataset.",
      "Here’s a diagram illustrating the anatomy of a boxplot:",
      "Anatomy of a boxplot (image source)",
      "Boxplot: why?",
      "A boxplot summarizes the distribution of a numeric variable across one or more groups, making it a convenient tool for quickly grasping differences between those groups.",
      "However, this summarization can also lead to the loss of important information, which can be a potential pitfall.",
      "Consider the boxplot below. It may seem evident that group C has higher values than the others. Yet, we can’t discern the underlying distribution of individual data points within each group or the total number of observations.",
      "SHOW CODE",
      "Let’s see what happens when the boxplot is improved using additional elements.",
      "Alternative 1️⃣: Adding jitter",
      "If the amount of data you are working with is not too large, adding jitter on top of your boxplot can make the graphic more insightful.",
      "SHOW CODE",
      "Here, some new patterns become clear.",
      "Group C has a smaller sample size compared to the other groups. This is definitely something to consider before concluding that group C has higher values than the others.",
      "Additionally, it appears that group B exhibits a bimodal distribution: the data points are clustered in two distinct groups around y = 18 and y = 13.",
      "Alternative 2️⃣: Switching to violin plot",
      "If you have a large sample size, using jitter may no longer be effective, as the dots can overlap and render the figure uninterpretable.",
      "An excellent alternative is the violin plot, which effectively illustrates the distribution of the data for each group. Unlike boxplots, violin plots provide a full understanding of the group’s distribution.",
      "SHOW CODE",
      "Here it is very clear that the groups have different distributions. The bimodal distribution of group B becomes obvious. Violin plots are a powerful way to display information — they are probably under-utilized compared to box plots.",
      "Alternative 3️⃣: Raincloud plot",
      "In the previous chart, the sample size for each group is indicated on the x-axis, below the group names. This is a good practice, as it highlights the under-representation of group C.",
      "However, displaying the actual data points can often provide more insight. Therefore, a half-violin plot that includes the raw data can serve as an effective alternative.",
      "It is called a raincloud plot!",
      "SHOW CODE",
      "Going further",
      "Hintze et al. 1998, Violin Plots: A Box Plot-Density Trace Synergism. PDF",
      "Making boxplots in R and Python",
      "Making violin plots in R and Python",
      "Dataviz decision tree",
      "Data To Viz is a comprehensive classification of chart types organized by data input format. Get a high-resolution version of our decision tree delivered to your inbox now!",
      "Subscribe"
    ]
  }
}
