Skip to content

Visualizations #4

@andrewallenbruce

Description

@andrewallenbruce

1. {ggpointless}

Code

library(ggpointless)
cols <- c("#f4ae1b", "#d77e7b", "#a84dbd", "#311dfc")

df2 <- data.frame(
  key = c("A", "B", "B", "C", "D"),
  x = c(0, 1, 6, 5, 6),
  xend = c(5, 4, 10, 8, 10)
)

ggplot(df2, aes(x = x, xend = xend, color = key, fill = key)) +
  geom_lexis(aes(linetype = after_stat(type)), size = 2.5, shape = 21, linewidth = 1.1) +
  coord_equal() +
  scale_x_continuous(breaks = c(df2$x, df2$xend)) +
  scale_color_manual(values = cols) +
  scale_linetype_identity() +
  ggthemes::theme_fivethirtyeight(base_size = 10) +
  labs(title = NULL, x = NULL) + 
  theme(
    legend.position = "none",
    axis.text.x = element_text(size = 12, face = "bold"),
    axis.text.y = element_text(size = 12, face = "bold"),
    panel.grid.minor = element_blank()
        )

Created on 2024-06-06 with reprex v2.1.0

Metadata

Metadata

Labels

documentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions