-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXX-legends.qmd
59 lines (50 loc) · 1.58 KB
/
XX-legends.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
```{r}
#| echo: false
source("code/before_script.R")
```
# Legends {#sec-legends}
```{r}
library(sf)
library(stars)
library(tmap)
ei_elev = read_stars("data/easter_island/ei_elev.tif")
```
```{r}
tm_shape(ei_elev) +
tm_raster(col.scale = tm_scale(values = "geyser"),
col.legend = tm_legend(title = "Elevation (m asl)"))
```
```{r}
tm_shape(ei_elev) +
tm_raster(col.scale = tm_scale(values = "geyser"),
col.legend = tm_legend(title = "Elevation (m asl)",
reverse = TRUE))
```
```{r}
tm_shape(ei_elev) +
tm_raster(col.scale = tm_scale(values = "geyser"),
col.legend = tm_legend(title = "Elevation (m asl)",
position = tm_pos_in("right", "bottom")))
```
```{r}
tm_shape(ei_elev) +
tm_raster(col.scale = tm_scale(values = "geyser"),
col.legend = tm_legend(title = "Elevation (m asl)",
position = tm_pos_in("right", "bottom"),
bg.color = "gray", bg.alpha = 0.5))
```
```{r}
tm_shape(ei_elev) +
tm_raster(col.scale = tm_scale_continuous(values = "geyser"),
col.legend = tm_legend(title = "Elevation (m asl)",
orientation = "landscape",
position = tm_pos_out("center", "top",
"center")))
```
```{r}
tm_shape(ei_elev) +
tm_raster(col.scale = tm_scale(values = "geyser"),
col.legend = tm_legend(show = FALSE))
```
<!-- tm_legend_bivariate -->
<!-- tm_legend_combine -->