diff --git a/NAMESPACE b/NAMESPACE
index 30d3736e..36620969 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -93,9 +93,11 @@ importFrom(graphics,rasterImage)
importFrom(graphics,rect)
importFrom(graphics,rug)
importFrom(graphics,segments)
+importFrom(graphics,strheight)
importFrom(graphics,strwidth)
importFrom(graphics,text)
importFrom(graphics,title)
+importFrom(graphics,xinch)
importFrom(stats,aggregate)
importFrom(stats,approx)
importFrom(stats,as.formula)
diff --git a/NEWS.md b/NEWS.md
index e9235aae..22328b12 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -8,14 +8,25 @@ where the formatting is also better._
### Aesthetic changes
+The main focus of v0.7.0 is bringing various aesthetic improvements to
+**tinyplot**. These aesthetic improvements should carry over to all of your
+(tiny)plots automatically and do not require any changes to user-facing inputs
+or the core API. Some of your plots may look slightly different from before.
+But we hope that you agree the following changes result in better looking
+visualizations.
+
+- **Left-justified legends**. Legend titles and labels are now left-justified by
+ default for vertical, side-positioned legends (e.g., `"right!"`, `"left!"`).
+ This is a change from the previous (base R default) of centered legends. To
+ revert to the old behaviour globally, simply set `tpar(ljust = "c(enter)")`.
+ Or, change a single plot by passing the parameter as part of the legend list
+ arguments, e.g. `plt(..., legend = list("c"))`. (#500 @grantmcdermott)
+
- **Dynamic themes**. We have significantly refactored our _dynamic_ themes
logic. Recall, these are themes like `"dynamic"`, `"clean"`, `"bw"`, etc. that
automatically adjust margin spacing and related plot elements to reduce
- whitespace and improve the overall plot aesthetic. This internal refactoring
- has some user-facing implications, insofar as it can affect the appearance of
- your plots. Technically this makes it a "breaking" aesthetic changes, since
- some of your plots might look slightly different from before. But we feel that
- these are clear improvements. (#549 @grantmcdermott, @vincentarelbundock)
+ whitespace and improve the overall plot aesthetic.
+ (#549 @grantmcdermott, @vincentarelbundock)
- Plot margins now correctly respond to missing and/or multi-line `main`,
`sub`, and `x`/`y` axis titles. For example, a plot without a `main` (or
@@ -38,6 +49,10 @@ where the formatting is also better._
lowercase letters (`"x"`, `"y"`, `"xy"`) draw a finer grid with additional
lines at the midpoints between ticks. Thanks to @zeileis for the suggestion.
(#578 @grantmcdermott)
+- New `ljust` parameter for controlling legend title and label justification.
+ Accepts values of `"l(eft)"` (default) or `"c(enter")`. Can be set per-plot
+ via `legend = list(..., ljust = "c")`, or globally via `tpar(ljust = "c")`.
+ (#500 @grantmcdermott)
- New `"dynamic"` theme that now serves as the foundation for all other dynamic
(tiny)themes. (#549 @grantmcdermott)
diff --git a/R/legend.R b/R/legend.R
index f341a3a8..db596b23 100644
--- a/R/legend.R
+++ b/R/legend.R
@@ -205,6 +205,24 @@ measure_legend_inset = function(legend_env) {
}
+compute_ljust_text_width = function(legend_env) {
+ if (!isTRUE(legend_env$ljust)) return(invisible(NULL))
+
+ args_oh = modifyList(legend_env$args,
+ list(plot = FALSE, title = NULL, text.width = 0), keep.null = TRUE)
+ overhead = do.call("legend", args_oh)$rect$w
+
+ args_nat = modifyList(legend_env$args,
+ list(plot = FALSE, text.width = NULL), keep.null = TRUE)
+ target_w = do.call("legend", args_nat)$rect$w
+
+ tw_needed = target_w - overhead
+ if (tw_needed > 0) {
+ legend_env$args[["text.width"]] = tw_needed
+ }
+}
+
+
# Internal workhorse function for legend rendering
# This function is called inside recordGraphics() so that all coordinate-dependent
# calculations are re-executed when the plot window is resized
@@ -216,18 +234,29 @@ tinylegend = function(legend_env) {
legend_env$ooma = legend_env$ooma_base
legend_env$args[["inset"]] = legend_env$inset_base
+ # Clear stale text.width before measuring (measurement doesn't need it)
+ if (isTRUE(legend_env$ljust)) {
+ legend_env$args[["text.width"]] = NULL
+ }
+
# Re-measure legend dimensions (device size may have changed on resize)
legend_env$dims = measure_fake_legend(legend_env)
# Calculate and apply soma (outer margin adjustment based on legend size)
- soma = if (legend_env$outer_side) {
- grconvertX(legend_env$dims$rect$w, to = "lines") - grconvertX(0, to = "lines")
- } else if (legend_env$outer_end) {
- grconvertY(legend_env$dims$rect$h, to = "lines") - grconvertY(0, to = "lines")
+ # When soma_target is set (multi-legend), use it directly so all legends
+ # share the same outer margin and their left edges align.
+ if (!is.null(legend_env$soma_target)) {
+ soma = legend_env$soma_target
} else {
- 0
+ soma = if (legend_env$outer_side) {
+ grconvertX(legend_env$dims$rect$w, to = "lines") - grconvertX(0, to = "lines")
+ } else if (legend_env$outer_end) {
+ grconvertY(legend_env$dims$rect$h, to = "lines") - grconvertY(0, to = "lines")
+ } else {
+ 0
+ }
+ soma = soma + sum(legend_env$lmar)
}
- soma = soma + sum(legend_env$lmar)
if (legend_env$outer_side) {
legend_env$ooma[if (legend_env$outer_right) 4 else 2] = soma
@@ -252,6 +281,11 @@ tinylegend = function(legend_env) {
plot.new()
setHook("before.plot.new", oldhook, action = "replace")
+ # Recompute text.width in the final coordinate context
+ if (isTRUE(legend_env$ljust)) {
+ compute_ljust_text_width(legend_env)
+ }
+
# Set the inset in legend args
legend_env$args[["inset"]] = if (legend_env$user_inset) {
legend_env$args[["inset"]] + legend_env$inset
@@ -757,11 +791,13 @@ build_legend_env = function(
#' @param draw Logical. If `FALSE`, no legend is drawn but the sizes are
#' returned. Note that a new (blank) plot frame will still need to be started
#' in order to perform the calculations.
+#' @param soma_target Numeric. Shared outer margin target (in lines) for
+#' multi-legend alignment. If `NULL`, each legend computes its own margin.
#'
#' @returns No return value, called for side effect of producing a(n empty) plot
#' with a legend in the margin.
#'
-#' @importFrom graphics grconvertX grconvertY rasterImage strwidth
+#' @importFrom graphics grconvertX grconvertY rasterImage strheight strwidth xinch
#' @importFrom grDevices as.raster recordGraphics
#' @importFrom utils modifyList
#'
@@ -840,7 +876,8 @@ draw_legend = function(
lmar = NULL,
has_sub = FALSE,
new_plot = TRUE,
- draw = TRUE
+ draw = TRUE,
+ soma_target = NULL
) {
if (is.null(lmar)) {
lmar = tpar("lmar")
@@ -889,13 +926,56 @@ draw_legend = function(
new_plot = new_plot
)
+ # Extract and strip ljust before any legend() calls
+ ljust_mode = legend_env$args[["ljust"]] %||% tpar("ljust") %||% "left"
+ ljust_mode = match.arg(ljust_mode, c("left", "center", "l", "c"))
+ if (ljust_mode == "l") ljust_mode = "left"
+ if (ljust_mode == "c") ljust_mode = "center"
+ legend_env$args[["ljust"]] = NULL
+
# Initial setup: adjust margins, call plot.new, and measure (but don't apply soma yet)
legend_outer_margins(legend_env, apply = FALSE)
+ # Legend justification (vertical, non-gradient, side-positioned only)
+ if (!legend_env$gradient && !isTRUE(legend_env$args[["horiz"]]) && !legend_env$outer_end) {
+
+ if (ljust_mode == "left") {
+ ttl = legend_env$args[["title"]]
+ # Compute title.adj to give 0.5*xch of left padding. Base R places
+ # the title at: left + title.adj * (box_w - strwidth(title)), so
+ # we solve for title.adj = 0.5*xch / slack.
+ if (is.null(legend_env$args[["title.adj"]]) && !is.null(ttl)) {
+ xch = par("cex") * xinch(par("cin")[1])
+ slack = legend_env$dims$rect$w - strwidth(ttl)
+ legend_env$args[["title.adj"]] = if (slack > 0) {
+ min(0.5 * xch / slack, 0.5)
+ } else {
+ 0
+ }
+ } else {
+ legend_env$args[["title.adj"]] = legend_env$args[["title.adj"]] %||% 0
+ }
+ if (is.null(legend_env$args[["text.width"]])) {
+ ttl = legend_env$args[["title"]]
+ if (!is.null(ttl)) {
+ lab_tw = max(strwidth(legend_env$args[["legend"]]))
+ ttl_tw = strwidth(ttl)
+ if (ttl_tw > lab_tw) {
+ legend_env$ljust = TRUE
+ }
+ }
+ }
+ } else {
+ legend_env$args[["title.adj"]] = legend_env$args[["title.adj"]] %||% 0.5
+ }
+ }
+
if (!draw) {
return(legend_env$dims)
}
+ legend_env$soma_target = soma_target
+
# Store base values AFTER legend_outer_margins setup (before soma/inset are applied)
# These are needed so tinylegend() can reset to them on each recordGraphics replay
legend_env$omar_base = legend_env$omar
diff --git a/R/legend_multi.R b/R/legend_multi.R
index 4b26cf82..789734d7 100644
--- a/R/legend_multi.R
+++ b/R/legend_multi.R
@@ -194,6 +194,18 @@ draw_multi_legend = function(
# is bigger than half the plot height.
linset = if (any(lheights > 0.5)) lheights[2] / sum(lheights) else 0.5
+ # Shared soma from widest legend so all legends use the same outer margin
+ max_w = max(lwidths)
+ lmar_vals = legend_list[[1]]$lmar %||% tpar("lmar")
+ soma_target = (grconvertX(max_w, to = "lines") - grconvertX(0, to = "lines")) +
+ sum(lmar_vals)
+
+ # Determine ljust mode (shared across dual legends)
+ ljust_mode = legend_list[[1]]$legend_args[["ljust"]] %||% tpar("ljust") %||% "left"
+ ljust_mode = match.arg(ljust_mode, c("left", "center", "l", "c"))
+ if (ljust_mode == "l") ljust_mode = "left"
+ if (ljust_mode == "c") ljust_mode = "center"
+
#
## Step 3: Reposition (via adjusted inset arg) and draw legends
#
@@ -211,8 +223,13 @@ draw_multi_legend = function(
legend_o = legend_list[[io]]
legend_o$new_plot = FALSE
legend_o$draw = TRUE
+ legend_o$soma_target = if (ljust_mode == "center") NULL else soma_target
legend_o$legend_args$inset = c(0, 0)
- legend_o$legend_args$inset[1] = if (o == 1) -abs(diff(lwidths)) / 2 else 0
+ legend_o$legend_args$inset[1] = if (ljust_mode == "center") {
+ if (o == 1) -abs(diff(lwidths)) / 2 else 0
+ } else {
+ 0
+ }
legend_o$legend_args$inset[2] = if (legend_o$idx == 1) linset + 0.01 else 1 - linset + 0.01
legend_o$idx = NULL
do.call(draw_legend, legend_o)
diff --git a/R/tinytheme.R b/R/tinytheme.R
index 856824a8..91c0be84 100644
--- a/R/tinytheme.R
+++ b/R/tinytheme.R
@@ -244,6 +244,7 @@ theme_default = list(
grid.col = "lightgray",
grid.lty = "dotted",
grid.lwd = 1,
+ ljust = "left",
lab = par("lab"), # c(5, 5, 7),
las = par("las"), # 0,
lwd = par("lwd"), # 1,
diff --git a/R/tpar.R b/R/tpar.R
index bedb76df..32e6035f 100644
--- a/R/tpar.R
+++ b/R/tpar.R
@@ -242,6 +242,7 @@ known_tpar = c(
"grid.col",
"grid.lty",
"grid.lwd",
+ "ljust",
"lmar",
"lty.xaxs",
"lty.yaxs",
@@ -273,6 +274,7 @@ assert_tpar = function(.tpar) {
assert_numeric(.tpar[["adj.ylab"]], len = 1, lower = 0, upper = 1, null.ok = TRUE, name = "adj.ylab")
assert_flag(.tpar[["cairo"]], name = "cairo")
assert_flag(.tpar[["dynmar"]], null.ok = FALSE, name = "dynmar")
+ assert_choice(.tpar[["ljust"]], choice = c("left", "center", "l", "c"), null.ok = TRUE, name = "ljust")
assert_numeric(.tpar[["lmar"]], len = 2, null.ok = TRUE, name = "lmar")
assert_numeric(.tpar[["ribbon.alpha"]], len = 1, lower = 0, upper = 1, null.ok = TRUE, name = "ribbon.alpha")
assert_numeric(.tpar[["grid.lwd"]], len = 1, lower = 0, null.ok = TRUE, name = "grid.lwd")
@@ -348,6 +350,9 @@ init_tpar = function(rm_hook = FALSE) {
.tpar$grid.lty = if (is.null(getOption("tinyplot_grid.lty"))) "dotted" else getOption("tinyplot_grid.lty")
.tpar$grid.lwd = if (is.null(getOption("tinyplot_grid.lwd"))) 1 else as.numeric(getOption("tinyplot_grid.lwd"))
+ # Legend justification
+ .tpar$ljust = if (is.null(getOption("tinyplot_ljust"))) "left" else getOption("tinyplot_ljust")
+
# Legend margin, i.e. gap between the legend and the plot elements
.tpar$lmar = if (is.null(getOption("tinyplot_lmar"))) c(1.0, 0.1) else as.numeric(getOption("tinyplot_lmar"))
diff --git a/inst/tinytest/_tinysnapshot/addTRUE.svg b/inst/tinytest/_tinysnapshot/addTRUE.svg
index c6100e54..fd675ab4 100644
--- a/inst/tinytest/_tinysnapshot/addTRUE.svg
+++ b/inst/tinytest/_tinysnapshot/addTRUE.svg
@@ -32,7 +32,7 @@
-cyl
+cyl
4
6
8
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_by.svg b/inst/tinytest/_tinysnapshot/aesthetics_by.svg
index 56889ddd..e4ee63aa 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_by.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_by.svg
@@ -38,7 +38,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_by_fill.svg b/inst/tinytest/_tinysnapshot/aesthetics_by_fill.svg
index eec0b7d2..04d88fe0 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_by_fill.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_by_fill.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_by_fill_alpha.svg b/inst/tinytest/_tinysnapshot/aesthetics_by_fill_alpha.svg
index d7ebca11..5e68b1a9 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_by_fill_alpha.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_by_fill_alpha.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_by_nocol.svg b/inst/tinytest/_tinysnapshot/aesthetics_by_nocol.svg
index dd1482fb..a46f6a25 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_by_nocol.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_by_nocol.svg
@@ -38,7 +38,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_by_par.svg b/inst/tinytest/_tinysnapshot/aesthetics_by_par.svg
index 99f4801d..f006b9a8 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_by_par.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_by_par.svg
@@ -36,7 +36,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_by_recycle.svg b/inst/tinytest/_tinysnapshot/aesthetics_by_recycle.svg
index 5c1c0c51..a92eef52 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_by_recycle.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_by_recycle.svg
@@ -37,7 +37,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_by_type_l.svg b/inst/tinytest/_tinysnapshot/aesthetics_by_type_l.svg
index 856812d5..4146d4d1 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_by_type_l.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_by_type_l.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_col_index.svg b/inst/tinytest/_tinysnapshot/aesthetics_col_index.svg
index bc1fc026..a1d08d1a 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_col_index.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_col_index.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_type_b.svg b/inst/tinytest/_tinysnapshot/aesthetics_type_b.svg
index 2772c06a..9ee0bb19 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_type_b.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_type_b.svg
@@ -36,7 +36,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_type_b_col_pch.svg b/inst/tinytest/_tinysnapshot/aesthetics_type_b_col_pch.svg
index e47cf95c..9268fe5a 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_type_b_col_pch.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_type_b_col_pch.svg
@@ -38,7 +38,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_type_b_lty.svg b/inst/tinytest/_tinysnapshot/aesthetics_type_b_lty.svg
index f5965fc5..6da74086 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_type_b_lty.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_type_b_lty.svg
@@ -36,7 +36,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_type_b_lwd.svg b/inst/tinytest/_tinysnapshot/aesthetics_type_b_lwd.svg
index 5d28a664..cfb78dd8 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_type_b_lwd.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_type_b_lwd.svg
@@ -36,7 +36,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/aesthetics_type_l.svg b/inst/tinytest/_tinysnapshot/aesthetics_type_l.svg
index 64b5dd78..ae789c3a 100644
--- a/inst/tinytest/_tinysnapshot/aesthetics_type_l.svg
+++ b/inst/tinytest/_tinysnapshot/aesthetics_type_l.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/barplot_aggregation.svg b/inst/tinytest/_tinysnapshot/barplot_aggregation.svg
index f42080b0..5c22f5d4 100644
--- a/inst/tinytest/_tinysnapshot/barplot_aggregation.svg
+++ b/inst/tinytest/_tinysnapshot/barplot_aggregation.svg
@@ -26,11 +26,11 @@
-
-
+
+
group
-1
-2
+1
+2
diff --git a/inst/tinytest/_tinysnapshot/barplot_custom_xtitle.svg b/inst/tinytest/_tinysnapshot/barplot_custom_xtitle.svg
index f83f9133..527459bb 100644
--- a/inst/tinytest/_tinysnapshot/barplot_custom_xtitle.svg
+++ b/inst/tinytest/_tinysnapshot/barplot_custom_xtitle.svg
@@ -28,7 +28,7 @@
-grp
+grp
0
1
diff --git a/inst/tinytest/_tinysnapshot/barplot_custom_ytitle.svg b/inst/tinytest/_tinysnapshot/barplot_custom_ytitle.svg
index 0fe2f886..260dc9a9 100644
--- a/inst/tinytest/_tinysnapshot/barplot_custom_ytitle.svg
+++ b/inst/tinytest/_tinysnapshot/barplot_custom_ytitle.svg
@@ -28,7 +28,7 @@
-grp
+grp
0
1
diff --git a/inst/tinytest/_tinysnapshot/barplot_facet.svg b/inst/tinytest/_tinysnapshot/barplot_facet.svg
index b746a77d..2357261e 100644
--- a/inst/tinytest/_tinysnapshot/barplot_facet.svg
+++ b/inst/tinytest/_tinysnapshot/barplot_facet.svg
@@ -28,7 +28,7 @@
-vs
+vs
0
1
diff --git a/inst/tinytest/_tinysnapshot/barplot_facet_free.svg b/inst/tinytest/_tinysnapshot/barplot_facet_free.svg
index bde0c767..e2fb58af 100644
--- a/inst/tinytest/_tinysnapshot/barplot_facet_free.svg
+++ b/inst/tinytest/_tinysnapshot/barplot_facet_free.svg
@@ -28,7 +28,7 @@
-vs
+vs
0
1
diff --git a/inst/tinytest/_tinysnapshot/barplot_flip_fancy.svg b/inst/tinytest/_tinysnapshot/barplot_flip_fancy.svg
index d2fe45b5..bf7ba34b 100644
--- a/inst/tinytest/_tinysnapshot/barplot_flip_fancy.svg
+++ b/inst/tinytest/_tinysnapshot/barplot_flip_fancy.svg
@@ -26,11 +26,11 @@
-
-
+
+
Survived
-No
-Yes
+No
+Yes
diff --git a/inst/tinytest/_tinysnapshot/barplot_group.svg b/inst/tinytest/_tinysnapshot/barplot_group.svg
index 27c6af86..bcea289e 100644
--- a/inst/tinytest/_tinysnapshot/barplot_group.svg
+++ b/inst/tinytest/_tinysnapshot/barplot_group.svg
@@ -28,7 +28,7 @@
-vs
+vs
0
1
diff --git a/inst/tinytest/_tinysnapshot/barplot_group_beside.svg b/inst/tinytest/_tinysnapshot/barplot_group_beside.svg
index c0901668..5d3dc336 100644
--- a/inst/tinytest/_tinysnapshot/barplot_group_beside.svg
+++ b/inst/tinytest/_tinysnapshot/barplot_group_beside.svg
@@ -28,7 +28,7 @@
-vs
+vs
0
1
diff --git a/inst/tinytest/_tinysnapshot/boxplot_facet_by.svg b/inst/tinytest/_tinysnapshot/boxplot_facet_by.svg
index 87d5d100..22c28214 100644
--- a/inst/tinytest/_tinysnapshot/boxplot_facet_by.svg
+++ b/inst/tinytest/_tinysnapshot/boxplot_facet_by.svg
@@ -30,7 +30,7 @@
-Diet
+Diet
1
2
3
diff --git a/inst/tinytest/_tinysnapshot/boxplot_groups.svg b/inst/tinytest/_tinysnapshot/boxplot_groups.svg
index 72300f3e..93510859 100644
--- a/inst/tinytest/_tinysnapshot/boxplot_groups.svg
+++ b/inst/tinytest/_tinysnapshot/boxplot_groups.svg
@@ -28,7 +28,7 @@
-supp
+supp
OJ
VC
diff --git a/inst/tinytest/_tinysnapshot/boxplot_groups_facets_with_missings.svg b/inst/tinytest/_tinysnapshot/boxplot_groups_facets_with_missings.svg
index 15773fb9..c1935416 100644
--- a/inst/tinytest/_tinysnapshot/boxplot_groups_facets_with_missings.svg
+++ b/inst/tinytest/_tinysnapshot/boxplot_groups_facets_with_missings.svg
@@ -26,13 +26,13 @@
-
-
-
+
+
+
factor(cyl)
-4
-6
-8
+4
+6
+8
diff --git a/inst/tinytest/_tinysnapshot/boxplot_groups_x_equivalent.svg b/inst/tinytest/_tinysnapshot/boxplot_groups_x_equivalent.svg
index ee666147..097e131a 100644
--- a/inst/tinytest/_tinysnapshot/boxplot_groups_x_equivalent.svg
+++ b/inst/tinytest/_tinysnapshot/boxplot_groups_x_equivalent.svg
@@ -28,7 +28,7 @@
-player2
+player2
female
male
diff --git a/inst/tinytest/_tinysnapshot/boxplot_groups_x_same.svg b/inst/tinytest/_tinysnapshot/boxplot_groups_x_same.svg
index ec221977..71732137 100644
--- a/inst/tinytest/_tinysnapshot/boxplot_groups_x_same.svg
+++ b/inst/tinytest/_tinysnapshot/boxplot_groups_x_same.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/bubble_cex_by.svg b/inst/tinytest/_tinysnapshot/bubble_cex_by.svg
index 999f1da6..9059cf2a 100644
--- a/inst/tinytest/_tinysnapshot/bubble_cex_by.svg
+++ b/inst/tinytest/_tinysnapshot/bubble_cex_by.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/bubble_dual_continuous.svg b/inst/tinytest/_tinysnapshot/bubble_dual_continuous.svg
index 67f9d883..bed5d073 100644
--- a/inst/tinytest/_tinysnapshot/bubble_dual_continuous.svg
+++ b/inst/tinytest/_tinysnapshot/bubble_dual_continuous.svg
@@ -26,55 +26,55 @@
-
- 2.0
- 2.5
- 3.0
- 3.5
- 4.0
-- -
-- -
-- -
-- -
-- -
-Sepal.Width
-
-
-
-
-
-iris$Petal.Width
-0.5
-1.0
-1.5
-2.0
-2.5
+
+ 2.0
+ 2.5
+ 3.0
+ 3.5
+ 4.0
+- -
+- -
+- -
+- -
+- -
+Sepal.Width
+
+
+
+
+
+iris$Petal.Width
+0.5
+1.0
+1.5
+2.0
+2.5
-
-
+
+
-
-Petal.Length
+
+Petal.Length
Sepal.Length
-
+
-
-
-
-
-
-
+
+
+
+
+
+
1
-2
-3
-4
-5
-6
-7
+2
+3
+4
+5
+6
+7
@@ -92,164 +92,164 @@
7.0
7.5
8.0
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/inst/tinytest/_tinysnapshot/bubble_dual_discrete.svg b/inst/tinytest/_tinysnapshot/bubble_dual_discrete.svg
index 585b79a8..46050225 100644
--- a/inst/tinytest/_tinysnapshot/bubble_dual_discrete.svg
+++ b/inst/tinytest/_tinysnapshot/bubble_dual_discrete.svg
@@ -26,50 +26,50 @@
-
-
-
-Species
-setosa
-versicolor
-virginica
-
-
-
-
-
-iris$Petal.Width
-0.5
-1.0
-1.5
-2.0
-2.5
+
+
+
+Species
+setosa
+versicolor
+virginica
+
+
+
+
+
+iris$Petal.Width
+0.5
+1.0
+1.5
+2.0
+2.5
-
-
+
+
-
-Petal.Length
+
+Petal.Length
Sepal.Length
-
+
-
-
-
-
-
-
+
+
+
+
+
+
1
-2
-3
-4
-5
-6
-7
+2
+3
+4
+5
+6
+7
@@ -87,164 +87,164 @@
7.0
7.5
8.0
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/inst/tinytest/_tinysnapshot/bubble_dual_fancy.svg b/inst/tinytest/_tinysnapshot/bubble_dual_fancy.svg
index 87271da7..476c1e63 100644
--- a/inst/tinytest/_tinysnapshot/bubble_dual_fancy.svg
+++ b/inst/tinytest/_tinysnapshot/bubble_dual_fancy.svg
@@ -26,230 +26,230 @@
-
- 2.0
- 2.5
- 3.0
- 3.5
- 4.0
-- -
-- -
-- -
-- -
-- -
-Sepal.Width
-
-
-
-
-
-iris$Petal.Width
-0.5
-1.0
-1.5
-2.0
-2.5
+
+ 2.0
+ 2.5
+ 3.0
+ 3.5
+ 4.0
+- -
+- -
+- -
+- -
+- -
+Sepal.Width
+
+
+
+
+
+iris$Petal.Width
+0.5
+1.0
+1.5
+2.0
+2.5
-
-
+
+
-
-Petal.Length
-Sepal.Length
+
+Petal.Length
+Sepal.Length
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-1
-2
-3
-4
-5
-6
+1
+2
+3
+4
+5
+6
7
-
-
-
-
-
-
-
-
-
-4.5
-5.0
-5.5
-6.0
-6.5
-7.0
-7.5
-8.0
-
+
+
+
+
+
+
+
+
+
+4.5
+5.0
+5.5
+6.0
+6.5
+7.0
+7.5
+8.0
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/inst/tinytest/_tinysnapshot/bubble_simple.svg b/inst/tinytest/_tinysnapshot/bubble_simple.svg
index 21939ce5..c231569a 100644
--- a/inst/tinytest/_tinysnapshot/bubble_simple.svg
+++ b/inst/tinytest/_tinysnapshot/bubble_simple.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
iris$Petal.Width
-0.5
-1.0
-1.5
-2.0
-2.5
+0.5
+1.0
+1.5
+2.0
+2.5
diff --git a/inst/tinytest/_tinysnapshot/bubble_simple_clim.svg b/inst/tinytest/_tinysnapshot/bubble_simple_clim.svg
index f0bea58d..bc2fb763 100644
--- a/inst/tinytest/_tinysnapshot/bubble_simple_clim.svg
+++ b/inst/tinytest/_tinysnapshot/bubble_simple_clim.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
iris$Petal.Width
-0.5
-1.0
-1.5
-2.0
-2.5
+0.5
+1.0
+1.5
+2.0
+2.5
diff --git a/inst/tinytest/_tinysnapshot/custom_type_log.svg b/inst/tinytest/_tinysnapshot/custom_type_log.svg
index af40ee85..64a06033 100644
--- a/inst/tinytest/_tinysnapshot/custom_type_log.svg
+++ b/inst/tinytest/_tinysnapshot/custom_type_log.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
diff --git a/inst/tinytest/_tinysnapshot/density_type_bw_sj.svg b/inst/tinytest/_tinysnapshot/density_type_bw_sj.svg
index 7e7e3127..3f965ccd 100644
--- a/inst/tinytest/_tinysnapshot/density_type_bw_sj.svg
+++ b/inst/tinytest/_tinysnapshot/density_type_bw_sj.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/density_type_factor.svg b/inst/tinytest/_tinysnapshot/density_type_factor.svg
index 233ac257..73c823e3 100644
--- a/inst/tinytest/_tinysnapshot/density_type_factor.svg
+++ b/inst/tinytest/_tinysnapshot/density_type_factor.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/density_type_fill.svg b/inst/tinytest/_tinysnapshot/density_type_fill.svg
index d5466004..bb61d5b7 100644
--- a/inst/tinytest/_tinysnapshot/density_type_fill.svg
+++ b/inst/tinytest/_tinysnapshot/density_type_fill.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/density_type_joint_bw.svg b/inst/tinytest/_tinysnapshot/density_type_joint_bw.svg
index 10cf4b73..5c7ae1b0 100644
--- a/inst/tinytest/_tinysnapshot/density_type_joint_bw.svg
+++ b/inst/tinytest/_tinysnapshot/density_type_joint_bw.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/density_type_joint_bw_logical.svg b/inst/tinytest/_tinysnapshot/density_type_joint_bw_logical.svg
index 7cef7157..1d2c3a78 100644
--- a/inst/tinytest/_tinysnapshot/density_type_joint_bw_logical.svg
+++ b/inst/tinytest/_tinysnapshot/density_type_joint_bw_logical.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/density_type_numeric.svg b/inst/tinytest/_tinysnapshot/density_type_numeric.svg
index 28d788b8..11487b22 100644
--- a/inst/tinytest/_tinysnapshot/density_type_numeric.svg
+++ b/inst/tinytest/_tinysnapshot/density_type_numeric.svg
@@ -28,7 +28,7 @@
-am
+am
0
1
diff --git a/inst/tinytest/_tinysnapshot/dodge_errorbar_add_lines.svg b/inst/tinytest/_tinysnapshot/dodge_errorbar_add_lines.svg
index d1d7be1d..5789fc1f 100644
--- a/inst/tinytest/_tinysnapshot/dodge_errorbar_add_lines.svg
+++ b/inst/tinytest/_tinysnapshot/dodge_errorbar_add_lines.svg
@@ -32,7 +32,7 @@
-model
+model
Model A
Model B
Model C
diff --git a/inst/tinytest/_tinysnapshot/dodge_errorbar_add_ribbon.svg b/inst/tinytest/_tinysnapshot/dodge_errorbar_add_ribbon.svg
index e7a31d7f..ea2b7a94 100644
--- a/inst/tinytest/_tinysnapshot/dodge_errorbar_add_ribbon.svg
+++ b/inst/tinytest/_tinysnapshot/dodge_errorbar_add_ribbon.svg
@@ -32,7 +32,7 @@
-model
+model
Model A
Model B
Model C
diff --git a/inst/tinytest/_tinysnapshot/dodge_pointrange.svg b/inst/tinytest/_tinysnapshot/dodge_pointrange.svg
index fdacb047..77188c89 100644
--- a/inst/tinytest/_tinysnapshot/dodge_pointrange.svg
+++ b/inst/tinytest/_tinysnapshot/dodge_pointrange.svg
@@ -32,7 +32,7 @@
-model
+model
Model A
Model B
Model C
diff --git a/inst/tinytest/_tinysnapshot/dodge_pointrange_false.svg b/inst/tinytest/_tinysnapshot/dodge_pointrange_false.svg
index 7526a50d..01018522 100644
--- a/inst/tinytest/_tinysnapshot/dodge_pointrange_false.svg
+++ b/inst/tinytest/_tinysnapshot/dodge_pointrange_false.svg
@@ -32,7 +32,7 @@
-model
+model
Model A
Model B
Model C
diff --git a/inst/tinytest/_tinysnapshot/dodge_pointrange_flip.svg b/inst/tinytest/_tinysnapshot/dodge_pointrange_flip.svg
index 03a80c14..ddcf84e0 100644
--- a/inst/tinytest/_tinysnapshot/dodge_pointrange_flip.svg
+++ b/inst/tinytest/_tinysnapshot/dodge_pointrange_flip.svg
@@ -32,7 +32,7 @@
-model
+model
Model A
Model B
Model C
diff --git a/inst/tinytest/_tinysnapshot/dodge_pointrange_true.svg b/inst/tinytest/_tinysnapshot/dodge_pointrange_true.svg
index ca58cb3a..233d4742 100644
--- a/inst/tinytest/_tinysnapshot/dodge_pointrange_true.svg
+++ b/inst/tinytest/_tinysnapshot/dodge_pointrange_true.svg
@@ -32,7 +32,7 @@
-model
+model
Model A
Model B
Model C
diff --git a/inst/tinytest/_tinysnapshot/ephemeral_default_theme_add.svg b/inst/tinytest/_tinysnapshot/ephemeral_default_theme_add.svg
index cbc30034..ab27d9b5 100644
--- a/inst/tinytest/_tinysnapshot/ephemeral_default_theme_add.svg
+++ b/inst/tinytest/_tinysnapshot/ephemeral_default_theme_add.svg
@@ -26,9 +26,9 @@
-
+
c("a", "a", "a")
-c(1, 1, 1)
+c(1, 1, 1)
diff --git a/inst/tinytest/_tinysnapshot/facet_by.svg b/inst/tinytest/_tinysnapshot/facet_by.svg
index adf7be9d..7f346831 100644
--- a/inst/tinytest/_tinysnapshot/facet_by.svg
+++ b/inst/tinytest/_tinysnapshot/facet_by.svg
@@ -28,7 +28,7 @@
-am
+am
0
1
diff --git a/inst/tinytest/_tinysnapshot/facet_by_equal.svg b/inst/tinytest/_tinysnapshot/facet_by_equal.svg
index dc74df3b..975debb9 100644
--- a/inst/tinytest/_tinysnapshot/facet_by_equal.svg
+++ b/inst/tinytest/_tinysnapshot/facet_by_equal.svg
@@ -29,7 +29,7 @@
-cyl
+cyl
4
6
8
diff --git a/inst/tinytest/_tinysnapshot/facet_density_by.svg b/inst/tinytest/_tinysnapshot/facet_density_by.svg
index c68a895d..de0e2cbf 100644
--- a/inst/tinytest/_tinysnapshot/facet_density_by.svg
+++ b/inst/tinytest/_tinysnapshot/facet_density_by.svg
@@ -28,7 +28,7 @@
-am
+am
0
1
diff --git a/inst/tinytest/_tinysnapshot/facet_density_by_equal.svg b/inst/tinytest/_tinysnapshot/facet_density_by_equal.svg
index 7005a653..07130b1e 100644
--- a/inst/tinytest/_tinysnapshot/facet_density_by_equal.svg
+++ b/inst/tinytest/_tinysnapshot/facet_density_by_equal.svg
@@ -29,7 +29,7 @@
-cyl
+cyl
4
6
8
diff --git a/inst/tinytest/_tinysnapshot/facet_density_fancy.svg b/inst/tinytest/_tinysnapshot/facet_density_fancy.svg
index 94c35cf1..8214a4ef 100644
--- a/inst/tinytest/_tinysnapshot/facet_density_fancy.svg
+++ b/inst/tinytest/_tinysnapshot/facet_density_fancy.svg
@@ -26,11 +26,11 @@
-
-
+
+
Transmission
-0
-1
+0
+1
Notes: Broken out by cylinder and transmission
diff --git a/inst/tinytest/_tinysnapshot/facet_density_fancy_formula.svg b/inst/tinytest/_tinysnapshot/facet_density_fancy_formula.svg
index 8c9a71e4..1abb2be0 100644
--- a/inst/tinytest/_tinysnapshot/facet_density_fancy_formula.svg
+++ b/inst/tinytest/_tinysnapshot/facet_density_fancy_formula.svg
@@ -26,11 +26,11 @@
-
-
+
+
Transmission
-0
-1
+0
+1
Notes: Broken out by cylinder and transmission
diff --git a/inst/tinytest/_tinysnapshot/facet_fancy.svg b/inst/tinytest/_tinysnapshot/facet_fancy.svg
index 8b5ccbb0..589f3501 100644
--- a/inst/tinytest/_tinysnapshot/facet_fancy.svg
+++ b/inst/tinytest/_tinysnapshot/facet_fancy.svg
@@ -26,11 +26,11 @@
-
-
+
+
Transmission
-0
-1
+0
+1
Notes: Broken out by cylinder and transmission
diff --git a/inst/tinytest/_tinysnapshot/facet_grid_fancy.svg b/inst/tinytest/_tinysnapshot/facet_grid_fancy.svg
index 7d9fa602..a1335021 100644
--- a/inst/tinytest/_tinysnapshot/facet_grid_fancy.svg
+++ b/inst/tinytest/_tinysnapshot/facet_grid_fancy.svg
@@ -26,13 +26,13 @@
-
-
-
+
+
+
Gears
-3
-4
-5
+3
+4
+5
Notes: Transmission (rows) vs Cylinders (cols)
diff --git a/inst/tinytest/_tinysnapshot/facet_ribbon_by.svg b/inst/tinytest/_tinysnapshot/facet_ribbon_by.svg
index 3eddf79c..ee876ddb 100644
--- a/inst/tinytest/_tinysnapshot/facet_ribbon_by.svg
+++ b/inst/tinytest/_tinysnapshot/facet_ribbon_by.svg
@@ -30,7 +30,7 @@
-am
+am
0
1
diff --git a/inst/tinytest/_tinysnapshot/facet_ribbon_by_equal.svg b/inst/tinytest/_tinysnapshot/facet_ribbon_by_equal.svg
index 26587a8f..7d8dd7cf 100644
--- a/inst/tinytest/_tinysnapshot/facet_ribbon_by_equal.svg
+++ b/inst/tinytest/_tinysnapshot/facet_ribbon_by_equal.svg
@@ -32,7 +32,7 @@
-cyl
+cyl
4
6
8
diff --git a/inst/tinytest/_tinysnapshot/facet_ribbon_fancy_add.svg b/inst/tinytest/_tinysnapshot/facet_ribbon_fancy_add.svg
index bd5ccd41..ed19d8f4 100644
--- a/inst/tinytest/_tinysnapshot/facet_ribbon_fancy_add.svg
+++ b/inst/tinytest/_tinysnapshot/facet_ribbon_fancy_add.svg
@@ -26,11 +26,11 @@
-
-
+
+
Transmission
-0
-1
+0
+1
Notes: Broken out by cylinder and transmission
diff --git a/inst/tinytest/_tinysnapshot/flip_density.svg b/inst/tinytest/_tinysnapshot/flip_density.svg
index 57025077..a6e6e7ce 100644
--- a/inst/tinytest/_tinysnapshot/flip_density.svg
+++ b/inst/tinytest/_tinysnapshot/flip_density.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/flip_facet_by.svg b/inst/tinytest/_tinysnapshot/flip_facet_by.svg
index af4bf5e9..f4aedfed 100644
--- a/inst/tinytest/_tinysnapshot/flip_facet_by.svg
+++ b/inst/tinytest/_tinysnapshot/flip_facet_by.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/flip_hist.svg b/inst/tinytest/_tinysnapshot/flip_hist.svg
index 6fc793e6..083b176f 100644
--- a/inst/tinytest/_tinysnapshot/flip_hist.svg
+++ b/inst/tinytest/_tinysnapshot/flip_hist.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/flip_p.svg b/inst/tinytest/_tinysnapshot/flip_p.svg
index 64d228b3..efc322f6 100644
--- a/inst/tinytest/_tinysnapshot/flip_p.svg
+++ b/inst/tinytest/_tinysnapshot/flip_p.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/flip_p_logx.svg b/inst/tinytest/_tinysnapshot/flip_p_logx.svg
index 64529eb8..34f18672 100644
--- a/inst/tinytest/_tinysnapshot/flip_p_logx.svg
+++ b/inst/tinytest/_tinysnapshot/flip_p_logx.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/flip_ribbon_pred.svg b/inst/tinytest/_tinysnapshot/flip_ribbon_pred.svg
index e5dbcbbe..de774a73 100644
--- a/inst/tinytest/_tinysnapshot/flip_ribbon_pred.svg
+++ b/inst/tinytest/_tinysnapshot/flip_ribbon_pred.svg
@@ -32,7 +32,7 @@
-cyl
+cyl
4
6
8
diff --git a/inst/tinytest/_tinysnapshot/formula_y1.svg b/inst/tinytest/_tinysnapshot/formula_y1.svg
index 774a436c..50113ffe 100644
--- a/inst/tinytest/_tinysnapshot/formula_y1.svg
+++ b/inst/tinytest/_tinysnapshot/formula_y1.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/grid_facet_xy.svg b/inst/tinytest/_tinysnapshot/grid_facet_xy.svg
index 3393dd1b..8203c9cf 100644
--- a/inst/tinytest/_tinysnapshot/grid_facet_xy.svg
+++ b/inst/tinytest/_tinysnapshot/grid_facet_xy.svg
@@ -26,13 +26,13 @@
-
-
-
+
+
+
factor(cyl)
-4
-6
-8
+4
+6
+8
diff --git a/inst/tinytest/_tinysnapshot/hist_byfacet.svg b/inst/tinytest/_tinysnapshot/hist_byfacet.svg
index 2d83fc4b..fd6d7491 100644
--- a/inst/tinytest/_tinysnapshot/hist_byfacet.svg
+++ b/inst/tinytest/_tinysnapshot/hist_byfacet.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/hist_grouped.svg b/inst/tinytest/_tinysnapshot/hist_grouped.svg
index a618ae76..b4830820 100644
--- a/inst/tinytest/_tinysnapshot/hist_grouped.svg
+++ b/inst/tinytest/_tinysnapshot/hist_grouped.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/hist_grouped_faceted.svg b/inst/tinytest/_tinysnapshot/hist_grouped_faceted.svg
index 441f682c..0ac56dba 100644
--- a/inst/tinytest/_tinysnapshot/hist_grouped_faceted.svg
+++ b/inst/tinytest/_tinysnapshot/hist_grouped_faceted.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/hist_grouped_fancy.svg b/inst/tinytest/_tinysnapshot/hist_grouped_fancy.svg
index 6a36bdf2..bfab9fc2 100644
--- a/inst/tinytest/_tinysnapshot/hist_grouped_fancy.svg
+++ b/inst/tinytest/_tinysnapshot/hist_grouped_fancy.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/hline.svg b/inst/tinytest/_tinysnapshot/hline.svg
index abb95004..b1637c00 100644
--- a/inst/tinytest/_tinysnapshot/hline.svg
+++ b/inst/tinytest/_tinysnapshot/hline.svg
@@ -29,7 +29,7 @@
-cyl
+cyl
4
6
8
diff --git a/inst/tinytest/_tinysnapshot/hline_recyle_by.svg b/inst/tinytest/_tinysnapshot/hline_recyle_by.svg
index 2f99729b..7cc5dacd 100644
--- a/inst/tinytest/_tinysnapshot/hline_recyle_by.svg
+++ b/inst/tinytest/_tinysnapshot/hline_recyle_by.svg
@@ -26,13 +26,13 @@
-
-
-
+
+
+
factor(cyl)
-4
-6
-8
+4
+6
+8
diff --git a/inst/tinytest/_tinysnapshot/legend_custom_s3.svg b/inst/tinytest/_tinysnapshot/legend_custom_s3.svg
index 142e259f..2f8d6b36 100644
--- a/inst/tinytest/_tinysnapshot/legend_custom_s3.svg
+++ b/inst/tinytest/_tinysnapshot/legend_custom_s3.svg
@@ -26,11 +26,11 @@
-
-
+
+
New Title
-A
-B
+A
+B
diff --git a/inst/tinytest/_tinysnapshot/legend_keyword_outerbottomleft.svg b/inst/tinytest/_tinysnapshot/legend_keyword_outerbottomleft.svg
index 0233bbf4..87c39065 100644
--- a/inst/tinytest/_tinysnapshot/legend_keyword_outerbottomleft.svg
+++ b/inst/tinytest/_tinysnapshot/legend_keyword_outerbottomleft.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/legend_keyword_outerleft.svg b/inst/tinytest/_tinysnapshot/legend_keyword_outerleft.svg
index a467850c..bc76a697 100644
--- a/inst/tinytest/_tinysnapshot/legend_keyword_outerleft.svg
+++ b/inst/tinytest/_tinysnapshot/legend_keyword_outerleft.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/legend_keyword_outertopright.svg b/inst/tinytest/_tinysnapshot/legend_keyword_outertopright.svg
index da1e17b7..417b629f 100644
--- a/inst/tinytest/_tinysnapshot/legend_keyword_outertopright.svg
+++ b/inst/tinytest/_tinysnapshot/legend_keyword_outertopright.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/legend_ljust_center_long.svg b/inst/tinytest/_tinysnapshot/legend_ljust_center_long.svg
new file mode 100644
index 00000000..37b2291d
--- /dev/null
+++ b/inst/tinytest/_tinysnapshot/legend_ljust_center_long.svg
@@ -0,0 +1,240 @@
+
+
diff --git a/inst/tinytest/_tinysnapshot/legend_ljust_center_short.svg b/inst/tinytest/_tinysnapshot/legend_ljust_center_short.svg
new file mode 100644
index 00000000..4a494d3a
--- /dev/null
+++ b/inst/tinytest/_tinysnapshot/legend_ljust_center_short.svg
@@ -0,0 +1,240 @@
+
+
diff --git a/inst/tinytest/_tinysnapshot/legend_ljust_dual_center.svg b/inst/tinytest/_tinysnapshot/legend_ljust_dual_center.svg
new file mode 100644
index 00000000..a624fd6c
--- /dev/null
+++ b/inst/tinytest/_tinysnapshot/legend_ljust_dual_center.svg
@@ -0,0 +1,252 @@
+
+
diff --git a/inst/tinytest/_tinysnapshot/legend_ljust_dual_left.svg b/inst/tinytest/_tinysnapshot/legend_ljust_dual_left.svg
new file mode 100644
index 00000000..c49ff25c
--- /dev/null
+++ b/inst/tinytest/_tinysnapshot/legend_ljust_dual_left.svg
@@ -0,0 +1,252 @@
+
+
diff --git a/inst/tinytest/_tinysnapshot/legend_ljust_left_long.svg b/inst/tinytest/_tinysnapshot/legend_ljust_left_long.svg
new file mode 100644
index 00000000..7353167b
--- /dev/null
+++ b/inst/tinytest/_tinysnapshot/legend_ljust_left_long.svg
@@ -0,0 +1,240 @@
+
+
diff --git a/inst/tinytest/_tinysnapshot/legend_ljust_left_short.svg b/inst/tinytest/_tinysnapshot/legend_ljust_left_short.svg
new file mode 100644
index 00000000..76826b3a
--- /dev/null
+++ b/inst/tinytest/_tinysnapshot/legend_ljust_left_short.svg
@@ -0,0 +1,240 @@
+
+
diff --git a/inst/tinytest/_tinysnapshot/legend_ljust_tpar_center.svg b/inst/tinytest/_tinysnapshot/legend_ljust_tpar_center.svg
new file mode 100644
index 00000000..37b2291d
--- /dev/null
+++ b/inst/tinytest/_tinysnapshot/legend_ljust_tpar_center.svg
@@ -0,0 +1,240 @@
+
+
diff --git a/inst/tinytest/_tinysnapshot/legend_lmar_left.svg b/inst/tinytest/_tinysnapshot/legend_lmar_left.svg
index 63eb2f91..8c795151 100644
--- a/inst/tinytest/_tinysnapshot/legend_lmar_left.svg
+++ b/inst/tinytest/_tinysnapshot/legend_lmar_left.svg
@@ -27,17 +27,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/legend_lmar_right.svg b/inst/tinytest/_tinysnapshot/legend_lmar_right.svg
index c1c029ac..e24c9a4a 100644
--- a/inst/tinytest/_tinysnapshot/legend_lmar_right.svg
+++ b/inst/tinytest/_tinysnapshot/legend_lmar_right.svg
@@ -27,17 +27,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/legend_long_left.svg b/inst/tinytest/_tinysnapshot/legend_long_left.svg
index f31fd316..a34385bf 100644
--- a/inst/tinytest/_tinysnapshot/legend_long_left.svg
+++ b/inst/tinytest/_tinysnapshot/legend_long_left.svg
@@ -27,17 +27,17 @@
-
-
-
-
-
+
+
+
+
+
What month of the year is it?
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/legend_long_right.svg b/inst/tinytest/_tinysnapshot/legend_long_right.svg
index e4c5b674..f28ded6a 100644
--- a/inst/tinytest/_tinysnapshot/legend_long_right.svg
+++ b/inst/tinytest/_tinysnapshot/legend_long_right.svg
@@ -27,17 +27,17 @@
-
-
-
-
-
+
+
+
+
+
What month of the year is it?
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/legend_spacing_ncol_right.svg b/inst/tinytest/_tinysnapshot/legend_spacing_ncol_right.svg
index c3d77239..66d8fdaa 100644
--- a/inst/tinytest/_tinysnapshot/legend_spacing_ncol_right.svg
+++ b/inst/tinytest/_tinysnapshot/legend_spacing_ncol_right.svg
@@ -126,7 +126,7 @@
-Chick
+Chick
18
16
15
diff --git a/inst/tinytest/_tinysnapshot/legend_true.svg b/inst/tinytest/_tinysnapshot/legend_true.svg
index 0dbc6e20..2af13262 100644
--- a/inst/tinytest/_tinysnapshot/legend_true.svg
+++ b/inst/tinytest/_tinysnapshot/legend_true.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/legend_user_labs.svg b/inst/tinytest/_tinysnapshot/legend_user_labs.svg
index 6fe2e749..204677e3 100644
--- a/inst/tinytest/_tinysnapshot/legend_user_labs.svg
+++ b/inst/tinytest/_tinysnapshot/legend_user_labs.svg
@@ -31,7 +31,7 @@
-Month
+Month
May
Jun
Jul
diff --git a/inst/tinytest/_tinysnapshot/legend_user_labs_override.svg b/inst/tinytest/_tinysnapshot/legend_user_labs_override.svg
index 0dbc6e20..2af13262 100644
--- a/inst/tinytest/_tinysnapshot/legend_user_labs_override.svg
+++ b/inst/tinytest/_tinysnapshot/legend_user_labs_override.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/model_glm_by.svg b/inst/tinytest/_tinysnapshot/model_glm_by.svg
index 7c9d083c..3a7d15d6 100644
--- a/inst/tinytest/_tinysnapshot/model_glm_by.svg
+++ b/inst/tinytest/_tinysnapshot/model_glm_by.svg
@@ -26,22 +26,22 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
factor(Month)
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/model_lm_by.svg b/inst/tinytest/_tinysnapshot/model_lm_by.svg
index 96c20699..7ff6fd49 100644
--- a/inst/tinytest/_tinysnapshot/model_lm_by.svg
+++ b/inst/tinytest/_tinysnapshot/model_lm_by.svg
@@ -26,22 +26,22 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
factor(Month)
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/model_loess_by.svg b/inst/tinytest/_tinysnapshot/model_loess_by.svg
index 8b863690..f26dbf4f 100644
--- a/inst/tinytest/_tinysnapshot/model_loess_by.svg
+++ b/inst/tinytest/_tinysnapshot/model_loess_by.svg
@@ -26,22 +26,22 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
factor(Month)
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/model_spline_by.svg b/inst/tinytest/_tinysnapshot/model_spline_by.svg
index 803812e0..b89f8a8a 100644
--- a/inst/tinytest/_tinysnapshot/model_spline_by.svg
+++ b/inst/tinytest/_tinysnapshot/model_spline_by.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
factor(Month)
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/model_spline_facet.svg b/inst/tinytest/_tinysnapshot/model_spline_facet.svg
index fc88e1c8..ad686b44 100644
--- a/inst/tinytest/_tinysnapshot/model_spline_facet.svg
+++ b/inst/tinytest/_tinysnapshot/model_spline_facet.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/palette_alpha.svg b/inst/tinytest/_tinysnapshot/palette_alpha.svg
index 9417ed61..6a662b31 100644
--- a/inst/tinytest/_tinysnapshot/palette_alpha.svg
+++ b/inst/tinytest/_tinysnapshot/palette_alpha.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/palette_function.svg b/inst/tinytest/_tinysnapshot/palette_function.svg
index ca46a0bf..e5d1fa8c 100644
--- a/inst/tinytest/_tinysnapshot/palette_function.svg
+++ b/inst/tinytest/_tinysnapshot/palette_function.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/palette_keyword.svg b/inst/tinytest/_tinysnapshot/palette_keyword.svg
index f8f78e22..84eeb4f9 100644
--- a/inst/tinytest/_tinysnapshot/palette_keyword.svg
+++ b/inst/tinytest/_tinysnapshot/palette_keyword.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/palette_keyword2.svg b/inst/tinytest/_tinysnapshot/palette_keyword2.svg
index 9ccca1f8..c10bf146 100644
--- a/inst/tinytest/_tinysnapshot/palette_keyword2.svg
+++ b/inst/tinytest/_tinysnapshot/palette_keyword2.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/palette_manual.svg b/inst/tinytest/_tinysnapshot/palette_manual.svg
index 3cc858dd..f41f5e2e 100644
--- a/inst/tinytest/_tinysnapshot/palette_manual.svg
+++ b/inst/tinytest/_tinysnapshot/palette_manual.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/readme_by.svg b/inst/tinytest/_tinysnapshot/readme_by.svg
index 0dbc6e20..2af13262 100644
--- a/inst/tinytest/_tinysnapshot/readme_by.svg
+++ b/inst/tinytest/_tinysnapshot/readme_by.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/readme_by_lty.svg b/inst/tinytest/_tinysnapshot/readme_by_lty.svg
index 9ff42812..b831c3d5 100644
--- a/inst/tinytest/_tinysnapshot/readme_by_lty.svg
+++ b/inst/tinytest/_tinysnapshot/readme_by_lty.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/readme_formula.svg b/inst/tinytest/_tinysnapshot/readme_formula.svg
index 0dbc6e20..2af13262 100644
--- a/inst/tinytest/_tinysnapshot/readme_formula.svg
+++ b/inst/tinytest/_tinysnapshot/readme_formula.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/readme_hershey_plus.svg b/inst/tinytest/_tinysnapshot/readme_hershey_plus.svg
index 125bf305..ed210fd3 100644
--- a/inst/tinytest/_tinysnapshot/readme_hershey_plus.svg
+++ b/inst/tinytest/_tinysnapshot/readme_hershey_plus.svg
@@ -36,45 +36,45 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/inst/tinytest/_tinysnapshot/readme_palette_tableau.svg b/inst/tinytest/_tinysnapshot/readme_palette_tableau.svg
index 12f631c0..9803a12e 100644
--- a/inst/tinytest/_tinysnapshot/readme_palette_tableau.svg
+++ b/inst/tinytest/_tinysnapshot/readme_palette_tableau.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/readme_pch_16.svg b/inst/tinytest/_tinysnapshot/readme_pch_16.svg
index a0925094..9b9f3200 100644
--- a/inst/tinytest/_tinysnapshot/readme_pch_16.svg
+++ b/inst/tinytest/_tinysnapshot/readme_pch_16.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
Month
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/readme_type_l.svg b/inst/tinytest/_tinysnapshot/readme_type_l.svg
index 64b5dd78..ae789c3a 100644
--- a/inst/tinytest/_tinysnapshot/readme_type_l.svg
+++ b/inst/tinytest/_tinysnapshot/readme_type_l.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/ribbon_dodge.svg b/inst/tinytest/_tinysnapshot/ribbon_dodge.svg
index 834310bb..68dc2895 100644
--- a/inst/tinytest/_tinysnapshot/ribbon_dodge.svg
+++ b/inst/tinytest/_tinysnapshot/ribbon_dodge.svg
@@ -30,7 +30,7 @@
-grp
+grp
A
B
diff --git a/inst/tinytest/_tinysnapshot/ridge_by.svg b/inst/tinytest/_tinysnapshot/ridge_by.svg
index cfb9b380..4f36d583 100644
--- a/inst/tinytest/_tinysnapshot/ridge_by.svg
+++ b/inst/tinytest/_tinysnapshot/ridge_by.svg
@@ -26,13 +26,13 @@
-
-
-
+
+
+
factor(cyl)
-4
-6
-8
+4
+6
+8
diff --git a/inst/tinytest/_tinysnapshot/ridge_by_y.svg b/inst/tinytest/_tinysnapshot/ridge_by_y.svg
index 12c4b80b..38d11933 100644
--- a/inst/tinytest/_tinysnapshot/ridge_by_y.svg
+++ b/inst/tinytest/_tinysnapshot/ridge_by_y.svg
@@ -29,7 +29,7 @@
-Species
+Species
virginica
versicolor
setosa
diff --git a/inst/tinytest/_tinysnapshot/ridge_by_y_theme_ridge.svg b/inst/tinytest/_tinysnapshot/ridge_by_y_theme_ridge.svg
index c49809a7..a8f967fc 100644
--- a/inst/tinytest/_tinysnapshot/ridge_by_y_theme_ridge.svg
+++ b/inst/tinytest/_tinysnapshot/ridge_by_y_theme_ridge.svg
@@ -29,7 +29,7 @@
-Species
+Species
virginica
versicolor
setosa
diff --git a/inst/tinytest/_tinysnapshot/ridge_by_y_theme_ridge2.svg b/inst/tinytest/_tinysnapshot/ridge_by_y_theme_ridge2.svg
index ab221ec4..aacb5a6e 100644
--- a/inst/tinytest/_tinysnapshot/ridge_by_y_theme_ridge2.svg
+++ b/inst/tinytest/_tinysnapshot/ridge_by_y_theme_ridge2.svg
@@ -29,7 +29,7 @@
-Species
+Species
virginica
versicolor
setosa
diff --git a/inst/tinytest/_tinysnapshot/segments_by.svg b/inst/tinytest/_tinysnapshot/segments_by.svg
index 90871bbd..bf4d3b59 100644
--- a/inst/tinytest/_tinysnapshot/segments_by.svg
+++ b/inst/tinytest/_tinysnapshot/segments_by.svg
@@ -28,7 +28,7 @@
-grp
+grp
A
B
diff --git a/inst/tinytest/_tinysnapshot/segments_by_extra.svg b/inst/tinytest/_tinysnapshot/segments_by_extra.svg
index 8fde6754..90e6cb93 100644
--- a/inst/tinytest/_tinysnapshot/segments_by_extra.svg
+++ b/inst/tinytest/_tinysnapshot/segments_by_extra.svg
@@ -28,7 +28,7 @@
-grp
+grp
A
B
diff --git a/inst/tinytest/_tinysnapshot/segments_by_xequal.svg b/inst/tinytest/_tinysnapshot/segments_by_xequal.svg
index e29a4e44..36436941 100644
--- a/inst/tinytest/_tinysnapshot/segments_by_xequal.svg
+++ b/inst/tinytest/_tinysnapshot/segments_by_xequal.svg
@@ -28,7 +28,7 @@
-grp
+grp
A
B
diff --git a/inst/tinytest/_tinysnapshot/segments_by_yequal.svg b/inst/tinytest/_tinysnapshot/segments_by_yequal.svg
index 9f7581fc..8f8c6af5 100644
--- a/inst/tinytest/_tinysnapshot/segments_by_yequal.svg
+++ b/inst/tinytest/_tinysnapshot/segments_by_yequal.svg
@@ -28,7 +28,7 @@
-grp
+grp
A
B
diff --git a/inst/tinytest/_tinysnapshot/spineplot_facet_by.svg b/inst/tinytest/_tinysnapshot/spineplot_facet_by.svg
index 4b31e217..1791afd6 100644
--- a/inst/tinytest/_tinysnapshot/spineplot_facet_by.svg
+++ b/inst/tinytest/_tinysnapshot/spineplot_facet_by.svg
@@ -30,7 +30,7 @@
-Class
+Class
1st
2nd
3rd
diff --git a/inst/tinytest/_tinysnapshot/spineplot_xby.svg b/inst/tinytest/_tinysnapshot/spineplot_xby.svg
index 059a4e03..f3c80f03 100644
--- a/inst/tinytest/_tinysnapshot/spineplot_xby.svg
+++ b/inst/tinytest/_tinysnapshot/spineplot_xby.svg
@@ -28,7 +28,7 @@
-Sex
+Sex
Female
Male
diff --git a/inst/tinytest/_tinysnapshot/spineplot_yby.svg b/inst/tinytest/_tinysnapshot/spineplot_yby.svg
index 1433f44a..3cb490b6 100644
--- a/inst/tinytest/_tinysnapshot/spineplot_yby.svg
+++ b/inst/tinytest/_tinysnapshot/spineplot_yby.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/summary_complex.svg b/inst/tinytest/_tinysnapshot/summary_complex.svg
index b071e8a5..e177f25c 100644
--- a/inst/tinytest/_tinysnapshot/summary_complex.svg
+++ b/inst/tinytest/_tinysnapshot/summary_complex.svg
@@ -30,7 +30,7 @@
-Diet
+Diet
1
2
3
diff --git a/inst/tinytest/_tinysnapshot/text_facets.svg b/inst/tinytest/_tinysnapshot/text_facets.svg
index 255c180e..a319af21 100644
--- a/inst/tinytest/_tinysnapshot/text_facets.svg
+++ b/inst/tinytest/_tinysnapshot/text_facets.svg
@@ -26,13 +26,13 @@
-
-
-
+
+
+
factor(cyl)
-4
-6
-8
+4
+6
+8
diff --git a/inst/tinytest/_tinysnapshot/tinyplot_add.svg b/inst/tinytest/_tinysnapshot/tinyplot_add.svg
index 92c6cb9e..aedb729f 100644
--- a/inst/tinytest/_tinysnapshot/tinyplot_add.svg
+++ b/inst/tinytest/_tinysnapshot/tinyplot_add.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/tinyplot_add_jitter_on_grouped_boxplot.svg b/inst/tinytest/_tinysnapshot/tinyplot_add_jitter_on_grouped_boxplot.svg
index 0a0032ed..3f8b4aea 100644
--- a/inst/tinytest/_tinysnapshot/tinyplot_add_jitter_on_grouped_boxplot.svg
+++ b/inst/tinytest/_tinysnapshot/tinyplot_add_jitter_on_grouped_boxplot.svg
@@ -28,7 +28,7 @@
-supp
+supp
OJ
VC
diff --git a/inst/tinytest/_tinysnapshot/tinyplot_add_jitter_on_grouped_violin.svg b/inst/tinytest/_tinysnapshot/tinyplot_add_jitter_on_grouped_violin.svg
index 4a8e977e..d464d24e 100644
--- a/inst/tinytest/_tinysnapshot/tinyplot_add_jitter_on_grouped_violin.svg
+++ b/inst/tinytest/_tinysnapshot/tinyplot_add_jitter_on_grouped_violin.svg
@@ -28,7 +28,7 @@
-supp
+supp
OJ
VC
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_basic.svg b/inst/tinytest/_tinysnapshot/tinytheme_basic.svg
index 9897f447..0c243a74 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_basic.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_basic.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("basic")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_bw.svg b/inst/tinytest/_tinysnapshot/tinytheme_bw.svg
index 45ad1965..0845c677 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_bw.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_bw.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("bw")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_classic.svg b/inst/tinytest/_tinysnapshot/tinytheme_classic.svg
index 866cbc38..c215c1b5 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_classic.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_classic.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("classic")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_clean.svg b/inst/tinytest/_tinysnapshot/tinytheme_clean.svg
index 41582919..4ad2e745 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_clean.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_clean.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("clean")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_clean2.svg b/inst/tinytest/_tinysnapshot/tinytheme_clean2.svg
index f45fd079..01c6017d 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_clean2.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_clean2.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("clean2")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_dark.svg b/inst/tinytest/_tinysnapshot/tinytheme_dark.svg
index e529c236..a05da310 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_dark.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_dark.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("dark")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_default.svg b/inst/tinytest/_tinysnapshot/tinytheme_default.svg
index 5a7fee72..c42efa94 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_default.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_default.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("default")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_dynamic.svg b/inst/tinytest/_tinysnapshot/tinytheme_dynamic.svg
index 6451150f..d748170b 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_dynamic.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_dynamic.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("dynamic")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_dynamic_clean.svg b/inst/tinytest/_tinysnapshot/tinytheme_dynamic_clean.svg
index 9071cf55..74bf61ee 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_dynamic_clean.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_dynamic_clean.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_dynamic_dark.svg b/inst/tinytest/_tinysnapshot/tinytheme_dynamic_dark.svg
index afecad7e..ec298224 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_dynamic_dark.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_dynamic_dark.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_dynamic_dynamic.svg b/inst/tinytest/_tinysnapshot/tinytheme_dynamic_dynamic.svg
index 1850ee5e..6df3d7df 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_dynamic_dynamic.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_dynamic_dynamic.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_ipsum.svg b/inst/tinytest/_tinysnapshot/tinytheme_ipsum.svg
index 9b74daa3..8fa157d6 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_ipsum.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_ipsum.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("ipsum")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_legend_left.svg b/inst/tinytest/_tinysnapshot/tinytheme_legend_left.svg
index be9bad4c..345a484c 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_legend_left.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_legend_left.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("clean") + legend = "left!"
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_minimal.svg b/inst/tinytest/_tinysnapshot/tinytheme_minimal.svg
index 0e81523f..0f18115c 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_minimal.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_minimal.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("minimal")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_ridge.svg b/inst/tinytest/_tinysnapshot/tinytheme_ridge.svg
index 15805627..a5a2569b 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_ridge.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_ridge.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("ridge")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_ridge2.svg b/inst/tinytest/_tinysnapshot/tinytheme_ridge2.svg
index 9d3c4f7c..a4bf50c7 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_ridge2.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_ridge2.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("ridge2")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_tufte.svg b/inst/tinytest/_tinysnapshot/tinytheme_tufte.svg
index faa6f3d7..8f8755f4 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_tufte.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_tufte.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("tufte")
diff --git a/inst/tinytest/_tinysnapshot/tinytheme_void.svg b/inst/tinytest/_tinysnapshot/tinytheme_void.svg
index bf1366fd..d7723bec 100644
--- a/inst/tinytest/_tinysnapshot/tinytheme_void.svg
+++ b/inst/tinytest/_tinysnapshot/tinytheme_void.svg
@@ -26,11 +26,11 @@
-
-
+
+
factor(am)
-0
-1
+0
+1
tinytheme("void")
diff --git a/inst/tinytest/_tinysnapshot/type_c_group.svg b/inst/tinytest/_tinysnapshot/type_c_group.svg
index 1e475bc3..e44590d6 100644
--- a/inst/tinytest/_tinysnapshot/type_c_group.svg
+++ b/inst/tinytest/_tinysnapshot/type_c_group.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/type_cap_s_group.svg b/inst/tinytest/_tinysnapshot/type_cap_s_group.svg
index f1e994a0..5fa8ecb4 100644
--- a/inst/tinytest/_tinysnapshot/type_cap_s_group.svg
+++ b/inst/tinytest/_tinysnapshot/type_cap_s_group.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/type_h_group.svg b/inst/tinytest/_tinysnapshot/type_h_group.svg
index e5c2bfef..e79db53c 100644
--- a/inst/tinytest/_tinysnapshot/type_h_group.svg
+++ b/inst/tinytest/_tinysnapshot/type_h_group.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/type_j.svg b/inst/tinytest/_tinysnapshot/type_j.svg
index 4c0fbf00..2f2c9c46 100644
--- a/inst/tinytest/_tinysnapshot/type_j.svg
+++ b/inst/tinytest/_tinysnapshot/type_j.svg
@@ -26,17 +26,17 @@
-
-
-
-
-
+
+
+
+
+
ordered(Month)
-5
-6
-7
-8
-9
+5
+6
+7
+8
+9
diff --git a/inst/tinytest/_tinysnapshot/type_l_empty.svg b/inst/tinytest/_tinysnapshot/type_l_empty.svg
index cf7c175a..aae20082 100644
--- a/inst/tinytest/_tinysnapshot/type_l_empty.svg
+++ b/inst/tinytest/_tinysnapshot/type_l_empty.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/type_n_by.svg b/inst/tinytest/_tinysnapshot/type_n_by.svg
index 5915031c..3cafb179 100644
--- a/inst/tinytest/_tinysnapshot/type_n_by.svg
+++ b/inst/tinytest/_tinysnapshot/type_n_by.svg
@@ -29,7 +29,7 @@
-Species
+Species
setosa
versicolor
virginica
diff --git a/inst/tinytest/_tinysnapshot/type_s_group.svg b/inst/tinytest/_tinysnapshot/type_s_group.svg
index eb1a03e5..80a366c6 100644
--- a/inst/tinytest/_tinysnapshot/type_s_group.svg
+++ b/inst/tinytest/_tinysnapshot/type_s_group.svg
@@ -31,7 +31,7 @@
-Month
+Month
5
6
7
diff --git a/inst/tinytest/_tinysnapshot/violin_facet_by.svg b/inst/tinytest/_tinysnapshot/violin_facet_by.svg
index 009efd9e..928b819b 100644
--- a/inst/tinytest/_tinysnapshot/violin_facet_by.svg
+++ b/inst/tinytest/_tinysnapshot/violin_facet_by.svg
@@ -30,7 +30,7 @@
-Diet
+Diet
1
2
3
diff --git a/inst/tinytest/_tinysnapshot/violin_groups.svg b/inst/tinytest/_tinysnapshot/violin_groups.svg
index 474cc139..03f02910 100644
--- a/inst/tinytest/_tinysnapshot/violin_groups.svg
+++ b/inst/tinytest/_tinysnapshot/violin_groups.svg
@@ -28,7 +28,7 @@
-supp
+supp
OJ
VC
diff --git a/inst/tinytest/_tinysnapshot/vline_vector.svg b/inst/tinytest/_tinysnapshot/vline_vector.svg
index 3666da2c..4e97a48e 100644
--- a/inst/tinytest/_tinysnapshot/vline_vector.svg
+++ b/inst/tinytest/_tinysnapshot/vline_vector.svg
@@ -29,7 +29,7 @@
-cyl
+cyl
4
6
8
diff --git a/inst/tinytest/test-legend.R b/inst/tinytest/test-legend.R
index 3818e7ce..805f423b 100644
--- a/inst/tinytest/test-legend.R
+++ b/inst/tinytest/test-legend.R
@@ -173,6 +173,60 @@ f = function() {
expect_snapshot_plot(f, label = "legend_lmar_top")
+# ljust parameter
+
+d = iris
+d$SpeciesVeryLongName = d$Species
+
+f = function() tinyplot(
+ Sepal.Length ~ Petal.Length | SpeciesVeryLongName, data = d,
+ legend = list("right!", bty = "o")
+)
+expect_snapshot_plot(f, label = "legend_ljust_left_long")
+
+f = function() tinyplot(
+ Sepal.Length ~ Petal.Length | Species, data = d,
+ legend = list("right!", bty = "o")
+)
+expect_snapshot_plot(f, label = "legend_ljust_left_short")
+
+f = function() tinyplot(
+ Sepal.Length ~ Petal.Length | SpeciesVeryLongName, data = d,
+ legend = list("right!", bty = "o", ljust = "center")
+)
+expect_snapshot_plot(f, label = "legend_ljust_center_long")
+
+f = function() tinyplot(
+ Sepal.Length ~ Petal.Length | Species, data = d,
+ legend = list("right!", bty = "o", ljust = "c")
+)
+expect_snapshot_plot(f, label = "legend_ljust_center_short")
+
+f = function() {
+ tpar(ljust = "center")
+ tinyplot(
+ Sepal.Length ~ Petal.Length | SpeciesVeryLongName, data = d,
+ legend = list("right!", bty = "o")
+ )
+ tpar(ljust = "left")
+}
+expect_snapshot_plot(f, label = "legend_ljust_tpar_center")
+
+f = function() tinyplot(
+ Sepal.Length ~ Petal.Length | SpeciesVeryLongName, data = d,
+ cex = d$Petal.Width, legend = list("right!", bty = "o")
+)
+expect_snapshot_plot(f, label = "legend_ljust_dual_left")
+
+f = function() tinyplot(
+ Sepal.Length ~ Petal.Length | SpeciesVeryLongName, data = d,
+ cex = d$Petal.Width, legend = list("right!", bty = "o", ljust = "c")
+)
+expect_snapshot_plot(f, label = "legend_ljust_dual_center")
+
+rm(d)
+
+
# reset par
par(op)
diff --git a/man/draw_legend.Rd b/man/draw_legend.Rd
index c7033708..971dd523 100644
--- a/man/draw_legend.Rd
+++ b/man/draw_legend.Rd
@@ -21,7 +21,8 @@ draw_legend(
lmar = NULL,
has_sub = FALSE,
new_plot = TRUE,
- draw = TRUE
+ draw = TRUE,
+ soma_target = NULL
)
}
\arguments{
@@ -70,6 +71,9 @@ margin a bit further.}
\item{draw}{Logical. If \code{FALSE}, no legend is drawn but the sizes are
returned. Note that a new (blank) plot frame will still need to be started
in order to perform the calculations.}
+
+\item{soma_target}{Numeric. Shared outer margin target (in lines) for
+multi-legend alignment. If \code{NULL}, each legend computes its own margin.}
}
\value{
No return value, called for side effect of producing a(n empty) plot