Skip to content

Commit 3540489

Browse files
committed
factor key sizes
1 parent 69f127d commit 3540489

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/plot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ xy_from_r = function(r, l, o) {
933933
xlab = "", ylab = "", xaxs = "i", yaxs = "i")
934934
},
935935
error = function(x) {
936-
sz = max(strwidth(z, "inches")) * 2.54 + par("ps")/12 # cm
936+
sz = max(strwidth(z, "inches")) * 2.54 * 1.1 + par("ps")/12 # cm
937937
stop(paste0("key.width too small, try key.width = lcm(", signif(sz, 3), ")"), call. = FALSE)
938938
}
939939
)

vignettes/sf5.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Keys for factor variables are a bit different, as we typically don't want to rot
8181

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

8787
# Class intervals

0 commit comments

Comments
 (0)