Getting Started with ggtwotone

library(ggtwotone)
library(ggplot2)

Introduction

ggtwotone extends ggplot2 with dual-stroke and contrast-aware geoms designed to improve the visibility of graphical annotations on complex backgrounds.

The package is particularly useful for scientific figures containing images, maps, microscopy data, and heatmaps, where standard single-color annotations may become difficult to distinguish.

Design Philosophy

The package follows three guiding principles:

Main Functions

Function Description
geom_segment_dual() Dual-stroke line segments
geom_curve_dual() Dual-stroke curved annotations
geom_path_dual() Dual-stroke paths
geom_function_dual() Dual-stroke mathematical functions
geom_lm_dual() Dual-tone regression lines
geom_text_contrast() Contrast-aware text labels
highlight_colors() High-contrast highlight palettes
adjust_contrast_pair() Contrast-aware color utilities

Typical Applications

ggtwotone is particularly useful for:

Documentation

Detailed examples and complete function documentation are available in:

Citation

If you use ggtwotone in published work, please cite the package using

citation("ggtwotone")