Skip to content

How to use setLegend #174

Answered by drserajames
cw-dvr8 asked this question in Q&A
Apr 10, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Does this help? I've not used the function before, so there might be a smarter way to do things. If you want a legend on a plot, then you can use the R legend function.

library(Racmacs)

map <- read.acmap(system.file("extdata/h3map2004.ace", package = "Racmacs"))

legend_map <- setLegend(map, 
  c("HK68", "EN72", "VI75", "TX77", "BK79", "SI87", "BE89", "BE92", "WU95", "SY97", "FU02"),
  fill=unique(agFill(map)))

view(legend_map)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@cw-dvr8
Comment options

@drserajames
Comment options

Answer selected by shwilks
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants