Skip to content

Commit c15fefe

Browse files
committed
visual -> map variable
1 parent ac40402 commit c15fefe

12 files changed

Lines changed: 51 additions & 51 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ docs/
2222
#figures/
2323
/.quarto/
2424
*_cache/
25-
*_files/
25+
*_files/
26+
local/

_quarto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ book:
4242
chapters:
4343
- "tm-shape.qmd"
4444
- "layers.qmd"
45-
- "visual-variables.qmd"
45+
- "map-variables.qmd"
4646
- "scales.qmd"
4747
- "legends.qmd"
4848
- "map-components.qmd"

charts.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source("code/before_script.R")
77

88
\index{charts}
99
Thematic maps usually represent one or more variables using colors, shapes, or sizes.
10-
Then, the map legend is used to explain the meaning of these visual variables (@sec-legends).
10+
Then, the map legend is used to explain the meaning of these map variables (@sec-legends).
1111
Such a legend can be expanded (or even replaced, @sec-charts-customization) with a chart that provides more information about the distribution of the variable values.
1212

1313
\index{histogram}
@@ -216,7 +216,7 @@ tm_shape(slo_tavg) +
216216
## Additional chart customization {#sec-charts-customization}
217217

218218
\index{ggplot2}
219-
All of the charts are directly based on the visual variables from the map layer and then created internally using the **ggplot2** package (@R-ggplot2).
219+
All of the charts are directly based on the map variables from the map layer and then created internally using the **ggplot2** package (@R-ggplot2).
220220
By default, however, the charts are much simplified, not showing all the details that **ggplot2** can provide, such as axis labels, titles, and various theme elements.
221221
<!-- https://github.com/geocompx/tmap/issues/10#issuecomment-3007409988 -->
222222

facets.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ tm_shape(slo_regions_ts) +
6161
```
6262

6363
Both approaches can be combined, allowing to create facets for multiple variables over time (@fig-facets3).
64-
Here, variables specified as a visual variable (`c("pop_dens", "gdppercap", "tourism")`) are shown in columns, while the faceting variable is set with `tm_facets(by = "time")` and presents the data for each year in a separate row.
64+
Here, variables specified as a map variable (`c("pop_dens", "gdppercap", "tourism")`) are shown in columns, while the faceting variable is set with `tm_facets(by = "time")` and presents the data for each year in a separate row.
6565

6666
```{r}
6767
#| label: fig-facets3
@@ -252,8 +252,8 @@ tm_shape(slo_tavg) +
252252
```
253253

254254
::: {.callout-note}
255-
Each visual variable (e.g., `col`, `size`, `shape`) has a related argument with the `.free` suffix, e.g., `col.free`, `size.free`, `shape.free`.
256-
These arguments are used to control whether the scales for the visual variable are applied freely across facets or are shared.
255+
Each map variable (e.g., `col`, `size`, `shape`) has a related argument with the `.free` suffix, e.g., `col.free`, `size.free`, `shape.free`.
256+
These arguments are used to control whether the scales for the map variable are applied freely across facets or are shared.
257257
For example, `col.free = TRUE` means that each facet has its own color scale, while `col.free = FALSE` means that all facets share the same color scale.
258258

259259
The `.free` arguments can also be used to control the scales for each facet dimension with a vector of logical values.

glossary.qmd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ glossary = tibble::tribble(
1919
"Map layer", "A map layer is a visual representation of geographical information. We distinguish two types: *data-driven* and *auxiliary* map layers. The former requires spatial objects, whereas the latter only requires the geographic information (bounding box and coordinate reference system).",
2020
"Options", "In the context of tmap, we refer to the options as settings, which can be configured using `tm_options`. These can be *layout* options (see **layout**) or otherwise (e.g., `'show.messages'`).",
2121
"Proportional symbols", "Proportional symbols are symbols that are drawn at geographic locations and that are sized proportionally with a data variable. The result is known as a 'proportional symbol map'. These symbols are usually bubbles (filled circles), but can also be small charts, called **glyphs**.",
22-
"Scale function", "A scale function determines how to scale a data variable to either a visual variable or a transformation variable. Examples: `tm_scale_continuous()`, `tm_scale_categorical()`.",
22+
"Scale function", "A scale function determines how to scale a data variable to a map variable, whether it controls a visual property or a transformation. Examples: `tm_scale_continuous()`, `tm_scale_categorical()`.",
2323
"tmap element", "A `tm_` object that can be stacked with the `+` operator. These are: `tm_shape()`, map layer functions (such as `tm_polygons()`), facet specification function `tm_facets()`, map components (such as `tm_compass()`), and layout/option specification functions, such as `tm_layout()`.",
2424
"Shape (object)", "'Shape' is a nickname for a spatial data object. It is used in `tm_shape()`.",
25-
"Shape (visual variable)", "The shape is a visual variable for some map layer functions, most prominently `tm_symbols()`. It determines the shape/design of the symbols.",
25+
"Shape (map variable)", "The shape is a map variable for some map layer functions, most prominently `tm_symbols()`. It determines the shape/design of the symbols.",
2626
"Style", "The overall layout of the map. Similar to ggplot2's 'theme' (see **theme**).",
2727
"Theme", "tmap stands for 'thematic maps', where *theme* refers to the topic of the data plotted on a map. Note that in ggplot2, a 'theme' refers to the overall layout, e.g., `ggplot2::theme_minimal()`. In tmap, we use **style** for this.",
28-
"Transformation variable", 'A variable of a data-driven map layer that determines a *transformation* of the spatial object. For instance, `tm_cartogram(size = "var")`.',
29-
"Visual variable", 'A variable of a data-driven map layer that determines a *visual* aspect. This can be data-driven, e.g., `tm_polygons(fill = "var")`, where `var` is the name of an `sf` column, or a constant value, such as `tm_polygons(fill = "blue")`.',
28+
"Map variable", 'A variable of a data-driven map layer that controls a *visual* property (e.g., color, size, shape) or a *transformation* (e.g., a cartogram) of the spatial object. This can be data-driven, e.g., `tm_polygons(fill = "var")` or `tm_cartogram(size = "var")`, where `var` is the name of an `sf` column, or a constant value, such as `tm_polygons(fill = "blue")`.',
3029
"Chart", 'A small non-spatial data visualization. In tmap for several purposes: 1) an addition to a legend `tm_polygons(fill = "var", fill.chart = tm_chart_histogram())`, 2) a glyph (see **glyphs**), 3) a custom chart plotted as an inset.',
3130
"Inset", "A visual object that is plotted on a specific (pre-defined) location. It can be a small map (**minimap**) or a **chart**."
3231
)

index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Whether you're a beginner in geospatial analysis or an experienced GIS user tran
1414
This book walks you through the full process of thematic mapping with **tmap**, including:
1515

1616
- Load, explore, and prepare spatial data in R
17-
- Build maps using **tmap**’s core components like shapes, layers, and visual variables
17+
- Build maps using **tmap**’s core components like shapes, layers, and map variables
1818
- Customize map appearance with legends, scales, layouts, and annotations
1919
- Create faceted, animated, and interactive maps for various audiences
2020
- Integrate **tmap** maps into reports, web apps, and Shiny dashboards

layers.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ layers_df |>
6868
<!--JN: Idea - also add a simple viz showing different kind of layers here (visual summary)-->
6969

7070
In this chapter, we focus on what map layers are available in **tmap** and how they differ from each other.
71-
@sec-visual-variables, on the other hand, is all about how to present information given in variables using colors, sizes, and shapes.
71+
@sec-map-variables, on the other hand, is all about how to present information given in variables using colors, sizes, and shapes.
7272

7373
## Polygons {#sec-polygons}
7474

@@ -151,7 +151,7 @@ slo_cities = read_sf("data/slovenia/slo_cities.gpkg")
151151
Symbols are a versatile type of map layer.
152152
They are usually used to represent point data but can also be used for lines and polygons.
153153
In the latter cases, they are located in the centroid coordinates of each feature.
154-
Their flexibility is also related to the ways symbols can be visualized -- it is possible to show values of a given variable by colors of symbols, their sizes, or shapes (more about that is explained in @sec-visual-variables).
154+
Their flexibility is also related to the ways symbols can be visualized -- it is possible to show values of a given variable by colors of symbols, their sizes, or shapes (more about that is explained in @sec-map-variables).
155155

156156
\index{tm\_symbols}
157157
The `tm_symbols()` is the main function in **tmap**, allowing to use and modify symbol elements (@fig-tmsymbols1).
@@ -257,7 +257,7 @@ tm_shape(slo_railroads) +
257257
tm_lines()
258258
```
259259

260-
Lines can be presented using different colors, widths, or types (@sec-visual-variables).
260+
Lines can be presented using different colors, widths, or types (@sec-map-variables).
261261
This allows to show a hierarchy (for example, increased line widths for higher capacity roads) or distinguish between types of objects (for example, blue rivers comparing to gray roads).
262262

263263
## Text {#sec-text}

layout.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source("code/before_script.R")
88
<!-- https://github.com/geocompx/tmap/issues/20#issuecomment-3209507327 -->
99

1010
\index{map layout}
11-
Map layout relates to all of the visual aspects of the created plot except the visual variables (@sec-visual-variables and @sec-scales), legends (@sec-legends-and-titles), map components (@sec-map-components), and their positions (@sec-positions).
11+
Map layout relates to all of the visual aspects of the created plot except the map variables (@sec-map-variables and @sec-scales), legends (@sec-legends-and-titles), map components (@sec-map-components), and their positions (@sec-positions).
1212
It includes the map background, frame, typography, scale, aspect ratio, margins, and more.
1313

1414
We can customize the map layout using the `tm_layout()` function.
@@ -53,7 +53,7 @@ tm +
5353
```
5454

5555
The `tm_layout()` function also has tools to modify the complete map color style with arguments such as `color.saturation`, `color.sepia_intensity`, and `color_vision_deficiency_sim.`
56-
The first one represents the saturation of all colors on the map, including the backgrounds, as well as visual variables such as the fill or color of polygons and lines.
56+
The first one represents the saturation of all colors on the map, including the backgrounds, as well as map variables such as the fill or color of polygons and lines.
5757
The `color.saturation` parameter accepts a value between `0` and `1`, where `0` means no color saturation (i.e., the map is black and white), and `1` means full-color saturation (i.e., the map is colorful, default) (@fig-layout-saturation).
5858
The value of `0` may be useful when we want to create a black-and-white map, for example, to print it on a black-and-white printer, while the values in between `0` and `1` can be used to create a more muted, stylized map.
5959

legends.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Legends are an essential part of most maps.
2222
They provide meaning to the symbols or colors used in the map, and often add information about the map's content.
2323
They allow for interpreting the map correctly, and are therefore crucial for the map's readability.
2424

25-
In **tmap**, legends are created automatically when we add a layer with a data-driven visual variable.
25+
In **tmap**, legends are created automatically when we add a layer with a data-driven map variable.
2626
By default, such a legend consists of a title based on the variable name and a color/shape/symbol scale (@fig-legend1). <!--REF to the color scale section?-->
2727
It is placed outside of the map frame, either on the right or on the bottom of the map, depending on the automatically determined map aspect ratio.
2828

@@ -37,7 +37,7 @@ tm_shape(slo_elev) +
3737
\index{tm\_legend}
3838
Such a legend is helpful for quick exploration of the data, but often, they are not sufficient for sharing the map with others.
3939
This chapter covers how to customize the legend's title, position, and appearance in **tmap**.
40-
Legends are also closely related to the visual variables and scales used in the map that were covered in chapters @sec-visual-variables and @sec-scales -- we recommend reading those chapters first.
40+
Legends are also closely related to the map variables and scales used in the map that were covered in chapters @sec-map-variables and @sec-scales -- we recommend reading those chapters first.
4141
Legends are customized using the `tm_legend()` function that is passed to `*.legend` arguments of the layer functions, e.g., `col.legend`, `shape.legend`, `size.legend`, etc.
4242

4343
Often, the most significant part of the legend is the title.

0 commit comments

Comments
 (0)