{r} tm_shape(World)+ tm_polygons( fill = "#76EE00", # fill color col = "blue", # line color lwd = 1.5, # line width lty = "dashed") # line type
{r} library(tmap)
{r} tm_shape(World)+ tm_polygons(fill = "grey90") + # constant fill color tm_symbols(size = "pop_est", # data variable, mapped to symbol size fill = "well_being", # data variable, mapped to symbol fill color shape = "income_grp") # data variable, mapped to symbol shape
```{r} tm_shape(World)+ tm_polygons(fill = “HPI”)
```{r}
tm_shape(World)+ tm_polygons(
fill = "HPI",
fill.scale = tm_scale_intervals(
style = "fisher", # a method to specify the classes
n = 7, # number of classes
midpoint = 40, # data value mapped to the middle palette color
values = "pu_gn_div" # color palette;
# run cols4all::c4a_gui() to explore color palettes
))
```{r}
tm_shape(World)+ tm_polygons( fill = “HPI”, fill.scale =
tm_scale_intervals( n = 6, # for n classes style = “fixed”,
breaks = c(0,10,20,30,40,50,60), # you need n+1 number of breaks values
= “pu_gn_div” ))
```{r}
library(ttmp)
```{r} tm_shape(metro) + tm_bubbles(size = “pop2020”) + tm_basemap(” Esri.OceanBasemap”)
```{r}
ttmp()
{r} tm_shape(metro) + tm_bubbles(size = "pop2020") + tm_basemap("CartoDB.DarkMatter") ttmp()
```{r} tm_shape(World) + tm_polygons( fill = “economy”, fill.chart = tm_chart_bar()) ttmp()
```{r}
tm_shape(World, crs = "+proj=eqearth") +
tm_polygons(
fill = "HPI") +
tm_layout(bg.color = "skyblue",
earth_boundary = TRUE,
frame = FALSE,
space.color = "white")
ttmp()
{r} tm_shape(World, bbox = "FULL", crs = "+proj=ortho +lat_0=30 +lon_0=0") + tm_polygons() + tm_xlab("Longitudes") + tm_ylab("Latitudes") ttmp()
{r} tm_shape(World, bbox = "FULL", crs = "+proj=ortho +lat_0=30 +lon_0=0") + tm_polygons() + tm_xlab("Longitudes") + tm_ylab("Latitudes")+ tm_graticules(n.x = 20, n.y = 10, col = "black", lwd = 2, labels.show = FALSE)+ tm_style("natural") ttmp()