Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

Stripchart in R: How to Use stripchart() with Jitter and Stack

How to draw a stripchart in R with stripchart(): grouping, vertical strips, jitter vs stack, and the ggplot2 geom_jitter equivalent.

Written and maintained by CASRAI Editorial Board

Last updated

A stripchart in R is drawn with the stripchart() function, which plots every observation as a point along a single axis, one strip per group. The R manual describes these as one-dimensional scatter plots (dot plots), and notes that these plots are a good alternative to boxplots when sample sizes are small. The main decision is how to handle points that share the same value: method = "overplot", "jitter" or "stack".

What a stripchart is used for in research

A stripchart shows the raw data rather than a summary. Each value is one point, so a reader can see group sizes, gaps and outliers directly. That is why the R manual points to it as an alternative to boxplots for small samples: a box and whiskers built from a handful of observations hides how few observations there are. For the boxplot side of the comparison, see the CASRAI guide to box plots in R; for two numeric variables, see scatterplots in R.

Install or access

stripchart() is documented in the graphics package of the R manual. Once R is running, ?stripchart opens its help page. The ggplot2 alternative in the table below is a separate package; the ggplot2 home page gives these install commands:

install.packages("ggplot2")
# or the whole collection
install.packages("tidyverse")

Step-by-step: drawing a stripchart

The default method has this usage in the R manual:

stripchart(x, method = "overplot", jitter = 0.1, offset = 1/3,
           vertical = FALSE, group.names, add = FALSE, at = NULL,
           xlim = NULL, ylim = NULL, ylab = NULL, xlab = NULL,
           dlab = "", glab = "", log = "", pch = 0,
           col = par("fg"), cex = par("cex"), axes = TRUE,
           frame.plot = axes, ...)
  1. Pass the data. x can be a numeric vector or a list of numeric vectors, one strip per list element. With a single vector you get one strip: stripchart(x).
  2. Group with a formula. A formula y ~ g groups the numeric variable y by the factor g. This example is adapted from the manual: stripchart(decrease ~ treatment, data = OrchardSprays), where OrchardSprays is one of R’s built-in datasets. (Data frames are covered in data frames in R.)
  3. Choose the orientation. The default is vertical = FALSE, so values run along the horizontal axis. Set vertical = TRUE to draw vertical strips. The manual’s own example is stripchart(decrease ~ treatment, main = "stripchart(OrchardSprays)", vertical = TRUE, log = "y", data = OrchardSprays), which also puts the data axis on a log scale.
  4. Separate tied points. Add method = "jitter" or method = "stack" (see the next section).
  5. Label the axes. Use xlab and ylab, or dlab and glab for the data axis and group axis. The manual says dlab and glab are used when xlab or ylab are not given.
  6. Add to an existing plot if needed. add = TRUE draws on the current plot, and at sets where the strip goes; it defaults to 1:n for n groups. The manual’s example adds a stacked strip at position 1.2: x <- rnorm(50); xr <- round(x, 1); stripchart(xr, method = "stack", add = TRUE, at = 1.2).

Which method for tied values: overplot, jitter or stack

The method decides what happens when several observations have the same or nearly the same value. The manual lists three:

Method What it does Setting and default Note from the manual
"overplot" Draws points on top of each other Default method Coincident points overlap
"jitter" Adds random displacement so coincident points separate jitter = 0.1 Separates coincident points
"stack" Stacks coincident points into a pile offset = 1/3, the spacing between stacked points in line heights The manual says stacking only makes sense for very granular data

“Very granular data” means values with many repeats, such as measurements rounded to one decimal. That is why the manual’s stacking example rounds the random normal values with round(x, 1) before stacking. On continuous values with no ties, stacking has nothing to pile up.

Output and how to read it

  • Every point is one observation. A stripchart does not draw medians, quartiles or means. What you see is the raw data, so the number of points per strip is the group size (with overplot, tied values hide each other, so count with jitter or stack).
  • Read position along the data axis only. The data axis is horizontal by default (X) and vertical when vertical = TRUE. Jitter exists to separate coincident points, so the small displacement it adds is not data; do not read it as a difference between observations.
  • Compare strips by position and spread. Check where each group sits on the data axis, how widely the points spread, and whether any single points lie far from the rest.

Troubleshooting

Points hide each other

The default method = "overplot" draws tied values at the same spot. Switch to method = "jitter", and if the strips still look crowded, raise the jitter amount from its default of 0.1.

Stacked points look wrong or do nothing

Stacking is meant for very granular data. If your values are continuous with few repeats, use "jitter" instead, or round the values first as the manual’s example does.

Axis labels are blank or on the wrong axis

dlab labels the data axis and glab labels the group axis. The data axis is X unless vertical = TRUE, so set the label to match the orientation you chose.

Groups are in an unexpected order or position

Groups are placed at at = 1:n by default. Set at explicitly to place strips where you want them.

Free alternatives

Base R’s stripchart() and the ggplot2 function geom_jitter() both draw jittered one-dimensional dot plots, and both are free and open source. The ggplot2 reference describes geom_jitter() as adding a small amount of random variation to the location of each point, and as a shortcut for geom_point(position = "jitter"). A matching call for the manual’s example is ggplot(OrchardSprays, aes(treatment, decrease)) + geom_jitter(width = 0.2). For more on the ggplot2 system, see ggplots in R.

Feature Base R stripchart() ggplot2 geom_jitter()
Where it comes from graphics package, R manual ggplot2 package, installed with install.packages("ggplot2")
How jitter is set method = "jitter" with jitter = 0.1 (amount) width and height, both NULL by default
Default amount 0.1 40% of the resolution of the data when omitted
What the number means Amount of jitter The jitter is added in both positive and negative directions, so the total spread is twice the value specified
Caution with categories Strips sit at at = 1:n Categorical data are aligned on integers, so a width or height of 0.5 makes the categories indistinguishable

If you want the plot to carry an extra variable or to join a longer ggplot2 workflow, geom_jitter() is the natural route. If you just need a quick look at raw values per group, stripchart() is a single call. Line width and styling arguments for base graphics are covered in lwd in R.

FAQ

What is a stripchart in R?

It is a one-dimensional scatter plot (dot plot) drawn by stripchart(): one point per observation along a single axis, with one strip per group.

When should I use a stripchart instead of a boxplot?

The R manual calls stripcharts a good alternative to boxplots when sample sizes are small; every observation stays visible, so group size is obvious.

How do I make the strips vertical?

Set vertical = TRUE. The default is FALSE.

How do I stop points from overlapping?

Use method = "jitter" to add random displacement, or method = "stack" for very granular data.

How do I group a stripchart by a factor?

Pass a formula such as y ~ g, with data = naming the data frame.

How do I draw a stripchart in ggplot2?

Use geom_jitter(), which is a shortcut for geom_point(position = "jitter").

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Stripchart in R: How to Use stripchart() with Jitter and Stack

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →