Skip to content

Commit

Permalink
add labels
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 committed Aug 24, 2021
1 parent f91b231 commit 8b68b6e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 045_lollipop_plots/045_lollipop_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,24 @@ g1 <- mpg_by_class_tbl %>%
geom_lollipop(
horizontal = TRUE,
point.colour = "dodgerblue",
point.size = 6,
point.size = 10,
color = "#2c3e50",
size = 1
)

g1

# * Customize Theme with tidyquant ----

g2 <- g1 +
geom_label(
aes(label = str_glue("Vehicle Class: {toupper(class)}
mpg: {round(mean_hwy)}")),
size = 3,
hjust = "outward",
nudge_x = 2
) +
expand_limits(x = 45) +
labs(
title = "Vehicle Fuel Economy Lollipop Plot",
x="Fuel Economy (MPG)", y = "Vehicle Class"
Expand Down

0 comments on commit 8b68b6e

Please sign in to comment.