Group Dumbbell

Authors

[Editor] Hu Zheng;

[Contributors]

Modified

2026-10-27

🤖 AI Skill — Download the Bizard unified skill for your AI assistant ⬇️ Download Skill ZIP
🔌 MCP Server — Let AI agents (Claude Code, Cursor, …) query Bizard live: claude mcp add bizard -- npx @openbiox/bizard-mcp — or the free hosted instance (no install, faster from mainland China): claude mcp add --transport http bizard http://biotree.top:38123/bizard-mcp/mcp 📖 MCP Docs
📖 Cite Bizard — if Bizard helps your research, please cite: Li, K., Zheng, H., Huang, K., et al. (2026). Bizard: A Community-Driven Platform for Accelerating and Enhancing Biomedical Data Visualization. iMetaMed, e70038. 🔗 DOI / BibTeX
Note

Hiplot website

This page is the tutorial for source code version of the Hiplot Group Dumbbell plugin. You can also use the Hiplot website to achieve no code ploting. For more information please see the following link:

https://hiplot.cn/basic/group-dumbbell?lang=en

Setup

  • System Requirements: Cross-platform (Linux/MacOS/Windows)

  • Programming language: R

  • Dependent packages: data.table; jsonlite; ggplot2; ggalt

# Install packages
if (!requireNamespace("data.table", quietly = TRUE)) {
  install.packages("data.table")
}
if (!requireNamespace("jsonlite", quietly = TRUE)) {
  install.packages("jsonlite")
}
if (!requireNamespace("ggplot2", quietly = TRUE)) {
  install.packages("ggplot2")
}
if (!requireNamespace("ggalt", quietly = TRUE)) {
  remotes::install_github("hrbrmstr/ggalt")
}

# Load packages
library(data.table)
library(jsonlite)
library(ggplot2)
library(ggalt)
sessioninfo::session_info("attached")
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.6.0 (2026-04-24)
 os       Ubuntu 24.04.4 LTS
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  C.UTF-8
 ctype    C.UTF-8
 tz       UTC
 date     2026-05-09
 pandoc   3.1.3 @ /usr/bin/ (via rmarkdown)
 quarto   1.9.37 @ /usr/local/bin/quarto

─ Packages ───────────────────────────────────────────────────────────────────
 package    * version    date (UTC) lib source
 data.table * 1.18.4     2026-05-06 [1] RSPM
 ggalt      * 0.6.1      2026-05-04 [1] Github (hrbrmstr/ggalt@8941f8c)
 ggplot2    * 4.0.3.9000 2026-05-04 [1] Github (tidyverse/ggplot2@6870419)
 jsonlite   * 2.0.0      2025-03-27 [1] RSPM

 [1] /home/runner/work/_temp/Library
 [2] /opt/R/4.6.0/lib/R/site-library
 [3] /opt/R/4.6.0/lib/R/library
 * ── Packages attached to the search path.

──────────────────────────────────────────────────────────────────────────────

Data Preparation

# Load data
data <- data.table::fread(jsonlite::read_json("https://hiplot.cn/ui/basic/group-dumbbell/data.json")$exampleData$textarea[[1]])
data <- as.data.frame(data)

# Convert data structure
data <- data[order(data[["group"]], data[["y1952"]]),]
data[["country"]] <- factor(data[["country"]], levels = data[["country"]])

# View data
head(data)
              country  y1952  y2007 group
13              Haiti 37.579 60.916     A
2             Bolivia 40.414 65.554     A
12          Guatemala 42.023 70.259     A
11        El Salvador 45.262 71.878     A
9  Dominican Republic 45.928 72.235     A
10            Ecuador 48.357 74.994     A

Visualization

# Group Dumbbell
p <- ggplot(data = data, aes(x = y1952, xend = y2007, y = country, color = group)) +
  geom_dumbbell(size = 1, size_xend = 2, size_x = 2) +
  theme_bw()

p
Figure 1: Group Dumbbell