From 0e0001dca47e713e8d8be055a71c5e199d588b96 Mon Sep 17 00:00:00 2001
From: Matthew Kay The
thickness
scalethickness subscale. For example:
df = data.frame(
- h = c(0,1,1,0, 0,2,2,0, 0,4/3,4/3,0, 0,1,1,0, 0,1.25,1.25,0, 0,.5,.5,0),
- x = c(0,1,4,5, 4,5,6,7, 6,7,9,10, 11,12,15,16, 1,2,4.2,5.2, 4,5,12,13),
- y = rep(c("a", "b", "a", "a", "b", "a"), each = 4),
+ h = c(0,1,1,0, 0,2,2,0, 0,4/3,4/3,0, 0,1,1,0, 0,1.25,1.25,0, 0,.5,.5,0),
+ x = c(0,1,4,5, 4,5,6,7, 6,7,9,10, 11,12,15,16, 1,2,4.2,5.2, 4,5,12,13),
+ y = rep(c("a", "b", "a", "a", "b", "a"), each = 4),
group = rep(c("c", "c", "d", "d", "c", "c"), each = 4),
panel = rep(c("e", "e", "e", "e", "f", "f"), each = 4),
- name = rep(c(1,2,"3a","3b",4,5), each = 4)
+ name = rep(c( 1, 2, "3a","3b", 4, 5 ), each = 4)
)
df_group = df %>%
@@ -408,14 +408,22 @@ Sharing thick
scale_y_continuous(breaks = NULL) +
theme(panel.background = element_rect(color = "gray70", fill = NA))
-prior_post_plot
Notice how the two geometries have different thickness
scales. If we add scale_thickness_shared()
to the plot,
they will be given the same scale:
prior_post_plot +
- scale_thickness_shared()
scaled_thickness_shared()
works by scaling values and
then tagging them with a special thickness()
datatype. That
@@ -574,7 +582,11 @@
height > 1<
y = letters[1:10]
) %>%
ggplot(aes(xdist = d, y = y)) +
- stat_slab(height = 3, color = "gray25")
+ stat_slab(height = 3, color = "gray25") +
+ labs(
+ title = "geom_slab()",
+ subtitle = "using height > 1 to create ridgeline plots"
+ )
+H-tq*
zvYB`xIY(2>rwFsHzmrDRiDCqq1P|>SE|;#OxPFuB>{s|n^aCcZx`w^*mI1t`VSVW{
z7mn5Su3x?rt8te?AZ*8OwN(N|?gAQ?uQY+S5c~+x;<<&*Di`QAOD_KdmsvG_9L +nIF9lQB`}+-PY7n
zDmvba{AcRSprs8|Gw9!N`P9uQu4F#<8xMggd2m$zI)l+4YN@M0-)e(>JaO+ZlHL6P
zer=`F5s-^zWWcgG{szC{X0)^5Ng+jd%yhNb^pg?24u
n!L_{