R ggtext package for rich text in ggplot2. Use for adding formatted text, markdown, and HTML to plots.
Scanned 6/5/2026
Install via CLI
openskills install LeoLin990405/r-analytics-skill---
name: ggtext
description: R ggtext package for rich text in ggplot2. Use for adding formatted text, markdown, and HTML to plots.
---
# ggtext
Improved text rendering for ggplot2.
## Basic Markdown
```r
library(ggplot2)
library(ggtext)
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title = "**Bold** and *italic* text") +
theme(plot.title = element_markdown())
```
## Colored Text
```r
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title = "<span style='color:red'>Red</span> and <span style='color:blue'>Blue</span>") +
theme(plot.title = element_markdown())
```
## Axis Labels
```r
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(
x = "Weight (*1000 lbs*)",
y = "Miles per gallon"
) +
theme(axis.title.x = element_markdown())
```
## Legend with Markdown
```r
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
geom_point() +
scale_color_manual(
values = c("red", "green", "blue"),
labels = c("**4** cyl", "**6** cyl", "**8** cyl")
) +
theme(legend.text = element_markdown())
```
## Text Box
```r
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
labs(title = "Title with **formatting**") +
theme(
plot.title = element_textbox_simple(
padding = margin(5, 5, 5, 5),
margin = margin(0, 0, 10, 0),
fill = "lightgray"
)
)
```
## Geom Richtext
```r
df <- data.frame(
x = 1:3,
y = 1:3,
label = c("**Bold**", "*Italic*", "<span style='color:red'>Red</span>")
)
ggplot(df, aes(x, y, label = label)) +
geom_richtext()
# Without box
ggplot(df, aes(x, y, label = label)) +
geom_richtext(fill = NA, label.color = NA)
```
## Images in Text
```r
# Include images
labs(title = "<img src='logo.png' width='20'/> Title")
```
## Facet Labels
```r
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
facet_wrap(~cyl, labeller = as_labeller(
c(`4` = "**4** cylinders", `6` = "**6** cylinders", `8` = "**8** cylinders")
)) +
theme(strip.text = element_markdown())
```
## Subscript/Superscript
```r
labs(
x = "CO<sub>2</sub> concentration",
y = "Area (m<sup>2</sup>)"
) +
theme(
axis.title.x = element_markdown(),
axis.title.y = element_markdown()
)
```
No comments yet. Be the first to comment!
This skill helps you track, analyze, and report on keyword ranking positions over time. It monitors both traditional SERP rankings and AI/GEO visibility to provide comprehensive search performance insights.
Find and analyze YouTube competitor channels using YouTube Data API v3. Discover competitors through keyword search, category matching, content similarity, and related channel discovery. Compare metrics, content strategies, and market positioning. Use when users want to (1) Find competitors for their YouTube channel, (2) Analyze competitor performance metrics, (3) Compare their channel against competitors, (4) Identify content gaps and opportunities, (5) Benchmark against similar creators, (6...
Get current weather and forecasts (no API key required).
Focused Signals scout for PostHog projects using revenue analytics. Watches the derived revenue product for upstream failures (Stripe sync stalls, capture regressions), config drift (missing subscription property, currency mix surprises, broken Stripe↔person joins, deferred-revenue gaps), and goal-miss escalations. Emits findings only when they clear the confidence bar; otherwise writes durable memory and closes out empty. Self-contained peer in the signals-scout-* fleet — no dependencies on ...
Focused Signals scout for finding observability gaps in PostHog itself — significant event volumes the team isn't tracking, custom events with no insight or dashboard coverage, insights pointing at events that have stopped firing, dashboards missing related context, critical events with no alerts. Watches the event-stream-vs-saved- inventory delta as the team's product evolves and emits findings recommending new insights, dashboard additions, or alerts when gaps clear the confidence bar. Self...