Skip to content

fix draw_key for GeomVector #15

@corybrunson

Description

@corybrunson

Currently the vector geom defaults to a marker (point) key rather than a segment/arrow key, which makes the legends illegible:

library(gggda)
#> Loading required package: ggplot2

ability.cov$cov |> 
  princomp() |> 
  getElement("loadings") |> 
  unclass() |> as.data.frame() |> tibble::rownames_to_column(var = "scale") |> 
  transform(type = ifelse(scale == "general", "composite", "primary")) |> 
  ggplot(aes(Comp.1, Comp.2)) +
  coord_equal() +
  geom_vector(aes(linetype = type, label = scale))

Created on 2025-10-02 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions