Learn R Programming

Author: Seung Hyun (Sam) Min

smplot2 (SM: Seung Hyun Min) is an R package for statistical data visualization that complements ggplot2. This package represents what I wish I had back when I was beginning to learn R. It aims to make every step of data visualization easy.

smplot was first created in May 2021, and due to the numerous deprecated and newly created primary functions, smplot has now evolved into smplot2.

Key functionalities include shortcuts for plotting elegant figures that are appropriate for scientific journals and functions that facilitate generating and annotating composite figures.

Installation using RStudio

You can install the released version of smplot2 from CRAN.

install.packages('smplot2')

The development version can be directly downloaded here:

install.packages("devtools")
devtools::install_github('smin95/smplot2')

To access an updated tutorial (sample codes and figures) of the package, please visit https://smin95.github.io/dataviz/.

Copy Link

Version

Install

install.packages('smplot2')

Monthly Downloads

624

Version

0.2.6

License

GPL-2

Maintainer

Seung Hyun (Sam) Min

Last Published

March 2nd, 2026

Functions in smplot2 (0.2.6)

sm_minimal

A minimal theme (no grid) with borders.
sm_auc_all

Calculating Area under Curve across multiple conditions and subjects
sm_power

Post-hoc power analysis using two-sample or paired t-test
sm_pointplot

Point plot with optional shadow
sm_forest

Forest plot
sm_forest_annot

Annotation of the error range on the forest plot
sm_auc

Calculation of the Area under a Curve (Trapezoidal numerical integration)
sm_hgrid

A minimalistic theme of horizontal major grids
sm_hist

Histogram with kernel density estimation (Gaussian) and rugs
sm_violin

Violin Plot with Jittered Individual Points
sm_raincloud

Raincloud Plot
sm_put_together

Combine Multiple Plots into a Single Composite Figure
sm_vgrid

Minimalistic theme with vertical major grids
sm_stdErr

Standard error
sm_statBlandAlt

Statistics for a Bland-Altman plot
sm_statCorr

Linear regression slope and statistical values (R or R2 and p values) from a paired correlation test.
sm_palette

A custom palette of colors
sm_bar

Bar Plot with Jittered Individual Points
sm_common_axis

A function to plot panels with common x- and y- axes
sm_color

SM custom palette of colors
sm_slope_all

Calculating the slope across multiple conditions and subjects
sm_slope

Slope Chart
sm_ci

Confidence interval
sm_boxplot

A Boxplot with Jittered Individual Points
sm_classic

A classical theme.
sm_add_point

Add a point annotation onto the combined plot
sm_add_text

Add a text annotation onto the combined plot
sm_add_legend

Adding a common legend on a combined figure
sm_bland_altman

A Bland Altman plot
sm_common_legend

Creating a common legend for subplots on a separate panel
sm_corr_avgErr

Superimposition of the average point with horizontal and vertical error bars in the correlation plot
sm_common_xlabel

Common x-axis label (title) for combined subplots
sm_common_ylabel

Common y-axis label (title) for combined subplots
sm_effsize

Cohen's d - effect size
sm_common_title

Common title for combined subplots
sm_panel_label

Writing a label for each panel of a combined figure
sm_slope_mean

Slope Chart with Mean for a Single Group
sm_hvgrid_minor

A theme with horizontal and vertical major and minor grids
sm_slope_theme

SM plot with a theme appropriate for the slope chart
sm_hvgrid

A minimalistic theme with major horizontal and vertical grids
sm_plot_clean

Remove xticklabels and yticklabels in selected panels for proper subplotting