$ show csdaw/ggprism
ggprism is an R package that extends ggplot2 to replicate the visual aesthetics of GraphPad Prism. It provides themes, color/fill/shape palettes, and specialized geoms/guides to create publication-ready plots matching Prism's default styling. Key functionalities include applying Prism-like themes via `theme_prism()`, using discrete palettes with `scale_*_prism()` functions, adding statistical annotations (e.g., p-value brackets) with `add_pvalue()` and `geom_bracket()`, and customizing axes with specialized guides like `guide_prism_offset()` for offset ticks. The package follows ggplot2 extension conventions, using ggproto for custom geoms, discrete_scale for scales, and guide objects for axis modifications. It includes built-in datasets (e.g., wing morphology data) and relies on standard R datasets in examples. External dependencies center on ggplot2, scales, and rlang, with optional packages like ggnewscale and patchwork used in vignettes.
The LLM identified 3 files worth highlighting for reuse:
Provides a self-contained function for adding p-value brackets and labels to ggplot2 plots. Handles data input, bracket positioning, and label formatting (including mathematical expressions via glue and parse). Demonstrates encapsulation of a complex annotation workflow that could be extracted for use in other ggplot2-based annotation tools with minimal modification.
Defines a GeomBracket ggproto object for drawing arbitrary brackets in ggplot2. Encapsulates the low-level logic for bracket rendering (positioning, styling) as a reusable geom. This component is independent of higher-level annotation logic and could be utilized in any package requiring bracket-like graphical elements in ggplot2.
Implements a custom axis guide for offset ticks (where ticks appear outside the plot area), a signature feature of GraphPad Prism. Showcases proficient use of ggplot2's guide system to create non-standard tick placements. This guide could be adapted for other custom axis tick requirements with minimal changes to the core logic.