I'm trying to achieve the following:
- Create line breaks in the y-axis row text (circled in red in the image below);
- Free up space in the left vertical 3rd of the plot.
I've found I can affect text via theme()
:
theme(
axis.text.y = element_text(size = 10),
plot.title = element_text(face = "bold"),
)
However, I can't find the correct argument to create line breaks within the following:
axis.text.y = element_text(size = 10)
Am I in the wrong area to accomplish my goal?
Again, the larger goal is to free up space in the left vertical portion of the overall plot. I have no idea how to begin to address that.
Complete code for the plot.
top_customers_tbl %>%
# Geometries ----
ggplot(aes(revenue, bikeshop_name)) +
geom_segment(aes(xend = 0, yend = bikeshop_name),
color = palette_light()[1],
size = 1) +
geom_point(size = -1,
color = palette_light()[1]) +
# Labels "inward" hjust special input ----
geom_label(aes(label = label_text),
hjust = "inward",
size = 3,
color = palette_light()[1]) +
# Formatting ----
scale_x_continuous(labels = scales::dollar_format(scale = 1e-6, suffix = "M")) +
labs(
title = str_glue("Top {n} Customers"),
subtitle = str_glue("Top 6 customers = 51% of revenue
\nStart: {year(min(bike_orderlines_tbl$order_date))}\nEnd: {year(max(bike_orderlines_tbl$order_date))}"),
x = "Revenue ($M)",
y = "Customer"
) +
theme_tq() +
theme(
axis.text.y = element_text(size = 10),
plot.title = element_text(face = "bold"),
)