Skip to content

Commit

Permalink
factor key sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Aug 18, 2023
1 parent 69f127d commit 3540489
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ xy_from_r = function(r, l, o) {
xlab = "", ylab = "", xaxs = "i", yaxs = "i")
},
error = function(x) {
sz = max(strwidth(z, "inches")) * 2.54 + par("ps")/12 # cm
sz = max(strwidth(z, "inches")) * 2.54 * 1.1 + par("ps")/12 # cm
stop(paste0("key.width too small, try key.width = lcm(", signif(sz, 3), ")"), call. = FALSE)
}
)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/sf5.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Keys for factor variables are a bit different, as we typically don't want to rot

```{r}
nc$f = cut(nc$AREA, 10)
plot(nc["f"], axes = TRUE, key.pos = 4, pal = sf.colors(10), key.width = lcm(4.5))
plot(nc["f"], axes = TRUE, key.pos = 4, pal = sf.colors(10), key.width = lcm(5))
```

# Class intervals
Expand Down

0 comments on commit 3540489

Please sign in to comment.