Historical Context & Motivation
The impulse to visualize numerical data is centuries old, yet the specific chart types that dominate modern biostatistics each arose from distinct intellectual traditions. Before the eighteenth century, researchers presented results almost exclusively in tables—dense grids of numbers that taxed the reader's ability to detect patterns. The birth of statistical graphics coincided with the Enlightenment's emphasis on empirical evidence and the growing need to summarize large observational datasets in medicine, demography, and the natural sciences. Understanding why histograms, boxplots, and bar charts were invented illuminates the specific analytical questions each one is designed to answer—and why choosing the wrong plot can obscure rather than reveal patterns in biological data.
The central question this lesson addresses is deceptively simple: given a particular dataset and research question in biostatistics, which plot type conveys the most honest, complete, and useful picture of the data? Answering that question requires understanding what each visualization encodes, what it omits, and how it interacts with the measurement scale and distributional properties of the variable at hand.
Core Principles of Plot Selection
Choosing the appropriate plot is not a matter of aesthetic preference; it is determined by the intersection of three structural features of your data: the measurement scale (nominal, ordinal, interval, or ratio), the number and type of variables being displayed, and the analytical intent of the visualization—whether you aim to show a distribution, compare groups, or summarize counts. The following foundational ideas guide every plot-selection decision in biostatistics.
Match Scale to Geometry
Distribution vs. Summary
Comparison Across Groups
Frequency vs. Proportion
Audience and Convention
Visual Comparison of Plot Types
The diagram below places the three core plot types side by side, each applied to a hypothetical clinical dataset. On the left, a histogram displays the distribution of systolic blood pressure (a continuous variable) for 200 patients, revealing right skew and a possible secondary mode. In the center, a boxplot of the same variable condenses the distribution into its median, interquartile range, whiskers, and outliers—sacrificing distributional detail for compactness and easy group comparison. On the right, a bar chart tallies patients across categorical diagnosis groups, with separated bars reinforcing the discrete nature of the variable.
Notice three critical visual cues in the diagram. First, the histogram's bars are touching—this communicates that the x-axis is a continuous number line and that each bar spans a numeric interval (bin). Second, the boxplot compresses the entire distribution into a single glyph, making it ideal for side-by-side group comparisons without the visual clutter of overlapping histograms. Third, the bar chart's bars are separated by whitespace, signaling that the categories (HTN, DM, CKD) have no inherent numeric order and could be rearranged without altering the message.
How Each Plot Encodes Data
Although choosing a plot is largely a design decision, quantitative considerations govern how each chart transforms raw data into visual marks. Understanding the mathematics behind bin width selection, quartile computation, and bar height scaling ensures that the plots you produce are statistically faithful and not artifacts of arbitrary parameter choices.
Histogram: Bin Width and Frequency Density
Boxplot: Five-Number Summary
Bar Chart: Encoding Counts or Proportions
A bar chart maps each level of a categorical variable to a bar whose height (or length) equals the count or relative frequency of that level. Unlike a histogram, where the area of the bar encodes frequency density, in a bar chart it is the height alone that encodes magnitude, because all bars share the same width. This distinction matters: if you use unequal bin widths in a histogram, you must plot frequency density (count / bin width) on the y-axis so that area remains proportional to frequency.
Decision Flowchart for Plot Selection
The following flowchart formalizes the decision-making process that experienced biostatisticians use intuitively. Starting from the type of variable on the x-axis, the chart branches through analytical intent—whether you seek to display a distribution, compare groups, or summarize frequencies—and terminates at the recommended plot type. While real-world decisions involve additional nuances (sample size, audience, publication standards), this flowchart covers the foundational logic.
| Criterion | Histogram | Boxplot | Bar Chart |
|---|---|---|---|
| Variable type | Continuous (interval/ratio) | Continuous (interval/ratio) | Categorical (nominal/ordinal) |
| Primary purpose | Display distribution shape, modality, skew | Compare medians, spread, and outliers across groups | Compare counts or proportions across categories |
| Bars touching? | Yes — continuous axis | N/A (box glyph) | No — gaps signal discrete categories |
| Best # of groups | 1 (overlay ≤ 2 with transparency) | 2–10+ side by side | 2–15 categories |
| Outlier detection | Visible in tails, but not flagged | Explicitly marked as individual points | Not applicable |
Worked Example: Choosing and Constructing Plots
Suppose you are analyzing data from a clinical trial comparing fasting blood glucose (FBG) levels across three treatment arms: Placebo (n = 50), Drug A (n = 50), and Drug B (n = 50). You also have data on each patient's diabetes classification (Type 1, Type 2, or Pre-diabetic). Your task is to select the most appropriate plot for each analysis question.
Strengths, Limitations, and Common Misuses
Each plot type has inherent trade-offs. A well-chosen visualization maximizes information transfer while minimizing cognitive load and potential for misinterpretation. The table below synthesizes the key strengths and limitations of each plot, followed by frequent misuses encountered in biomedical literature.
| Plot Type | Strengths | Limitations |
|---|---|---|
| Histogram | Reveals full distributional shape: skewness, kurtosis, modality, gaps, and outliers. Intuitive for audiences unfamiliar with statistical summaries. | Sensitive to bin width choice; different widths can suggest different shapes. Difficult to compare more than 2 groups simultaneously. Does not show individual data points. |
| Boxplot | Compact five-number summary; excellent for side-by-side comparison of many groups. Explicitly flags outliers. Robust to extreme values. | Hides distributional shape (bimodality invisible). Cannot reveal sample size without annotation. May mislead when distributions are multimodal. |
| Bar Chart | Clear representation of categorical frequencies. Easy to read and compare across levels. Universally understood by non-technical audiences. | Inappropriate for continuous data. Can mislead if y-axis does not start at zero (truncated axis inflates differences). Offers no distributional information. |
Common Misuses in Biomedical Literature
- Dynamite plots (bar charts with error bars) used to display continuous outcomes—these hide the distribution and can obscure bimodality, outliers, and sample size. Replace with boxplots, violin plots, or dot plots.
- Histograms for small samples (n < 20)—with so few observations, the histogram is dominated by bin-width artifacts. Use a dot plot or stem-and-leaf display instead.
- Pie charts for many categories—humans judge angles poorly; a bar chart outperforms a pie chart when comparing more than three or four categories.
- 3-D effects and chart-junk—three-dimensional bar charts distort area perception and violate Tufte's data-ink ratio principle. Always use flat, two-dimensional plots.
Connection to Advanced Visualization
The histogram, boxplot, and bar chart form the foundation of data visualization in biostatistics, but modern practice extends these primitives in several important directions. Understanding these extensions reveals the trajectory from introductory visualization to the sophisticated graphics encountered in peer-reviewed biomedical research, particularly in genomics, epidemiology, and clinical trial reporting.
| Basic Plot | Advanced Extension | When to Upgrade |
|---|---|---|
| Histogram | Kernel Density Estimate (KDE) | When you need a smooth estimate of the probability density function and want to overlay multiple groups without bin artifacts. |
| Boxplot | Violin Plot | When you need both the five-number summary and the distributional shape; violin plots overlay a mirrored KDE on a central box. |
| Boxplot | Raincloud Plot | When you want raw data points (jittered), a boxplot summary, and a half-KDE in a single panel—ideal for small-to-moderate n. |
| Bar Chart | Stacked / Grouped Bar Chart | When a second categorical variable (e.g., sex within treatment arm) must be visualized simultaneously. |
| Bar Chart | Mosaic Plot | When you wish to display the joint distribution of two categorical variables and assess their independence visually. |
As you progress into courses on multivariate analysis, survival analysis, and high-dimensional data (e.g., RNA-seq heatmaps), the logic of plot selection scales: always begin by identifying measurement scales and analytical intent, then select the geometry that most faithfully encodes the relevant features of the data. The principles you have learned here—continuous → histogram or boxplot, categorical → bar chart, comparison → compact glyph—remain the bedrock on which every advanced visualization is built.
Practice Problems
Lesson Summary
Selecting the right plot in biostatistics begins with identifying the measurement scale of your variable. Continuous variables (blood pressure, glucose, BMI) are displayed with histograms when the goal is to reveal the full distributional shape—skewness, modality, and tails—or with boxplots when comparing the median, spread, and outliers across multiple groups. Categorical variables (diagnosis, treatment arm, genotype) are displayed with bar charts whose separated bars reinforce the discrete, unordered nature of the categories.
Key decision heuristics include: histograms have touching bars (continuous axis), bar charts have separated bars (discrete categories), and boxplots compress a distribution into its five-number summary for efficient multi-group comparison. Avoid the dynamite plot (bar + error bar) for continuous outcomes—it obscures distributional features. As you advance, extend these foundational plots to kernel density estimates, violin plots, and raincloud plots for richer, more nuanced data communication.