Feel free to submit typos/errors/etc via the GitHub repository associated with the class: https://github.com/fhdsl/DaSEH
-
This page was last updated on 2024-10-03.
+
This page was last updated on 2024-10-08.
diff --git a/modules/Data_Visualization/Data_Visualization.Rmd b/modules/Data_Visualization/Data_Visualization.Rmd
index 760b90c7..82ce8c7b 100644
--- a/modules/Data_Visualization/Data_Visualization.Rmd
+++ b/modules/Data_Visualization/Data_Visualization.Rmd
@@ -14,10 +14,10 @@ opts_chunk$set(echo = TRUE,
fig.height = 4,
fig.width = 7,
comment = "")
-library(dasehr)
library(tidyverse)
library(tidyr)
-library(emo)
+install.packages('emoji', repos='http://cran.us.r-project.org', dependencies=TRUE)
+library(emoji)
```
## Recap
@@ -470,10 +470,26 @@ er_visits_4 %>% ggplot(aes(x = year,
- `scale_x_continuous()` and `scale_y_continuous()` can modify the scale of the axes
- by default, `ggplot()` removes points with missing values from plots.
+## GUT CHECK: If we get an empty plot what might we need to do?
+
+A. Add a `plot_` layer like `plot_point()`
+
+B. Add a `geom_` layer like `geom_point()`
+
+
+## GUT CHECK: How do we add more layers in ggplot2 plots?
+
+A. `%>%`
+
+B. `&`
+
+C. `+`
+
## Lab 1
-π [Class Website](https://daseh.org/)\
-π» [Lab](https://daseh.org/modules//Data_Visualization/lab/Data_Visualization_Lab.Rmd)
+π [Class Website](https://daseh.org/)
+π» [Lab](https://daseh.org/modules//Data_Visualization/lab/Data_Visualization_Lab.Rmd)
+π[Day 6 Cheatsheet](https://daseh.org/modules/cheatsheets/Day-6.pdf)
## theme() function:
@@ -729,7 +745,7 @@ er_bar +
## Tip - Check what you plot {.codesmall}
-`r emo::ji("warning")` May not be plotting what you think you are! `r emo::ji("warning")`
+`r emoji("warning")` May not be plotting what you think you are! `r emoji("warning")`
```{r, fig.width=5 , fig.height=3, fig.align='center'}
ggplot(er_visits_4, aes(x = county,
@@ -937,6 +953,19 @@ ggplotly(lots_of_lines)
Also check out the [`ggiraph` package](https://www.rdocumentation.org/packages/ggiraph/versions/0.6.1)
+## `patchwork` package
+
+Great for combining plots together
+
+Also check out the [`patchwork` package](https://patchwork.data-imaginist.com/)
+
+```{r, out.width= "80%", fig.align='center'}
+#install.packages("patchwork")
+library(patchwork)
+lots_of_lines + rp_fac_plot
+
+```
+
# Saving plots
## Saving a ggplot to file
@@ -953,6 +982,20 @@ ggsave(filename = "saved_plot.png", # will save in working directory
width = 6, height = 3.5) # by default in inches
```
+## GUT CHECK: How to we make sure that the boxplots are filled with color instead of just the outside boarder?
+
+A. Use the `fill` argument in the `aes` specification
+
+B. Use `color` argument in `geom_boxplot()`
+
+## GUT CHECK: If our plot is too complicated to read, what might be a good option to fix this?
+
+A. add more `theme()` layers
+
+B. Use `facet_grid()` to split the plot up
+
+
+
## Summary
- The `theme()` function helps you specify aspects about your plot
@@ -973,6 +1016,8 @@ Check out this [guide](https://jhudatascience.org/tidyversecourse/dataviz.html#m
π [Class Website](https://daseh.org/)\
π» [Lab](https://daseh.org/modules//Data_Visualization/lab/Data_Visualization_Lab.Rmd)
+π[Day 6 Cheatsheet](https://daseh.org/modules/cheatsheets/Day-6.pdf)
+π[Posit's theme cheatsheet](https://github.com/claragranell/ggplot2/blob/main/ggplot_theme_system_cheatsheet.pdf)
```{r, fig.alt="The End", out.width = "50%", echo = FALSE, fig.align='center'}
knitr::include_graphics(here::here("images/the-end-g23b994289_1280.jpg"))
@@ -1150,15 +1195,4 @@ library(directlabels)
direct.label(lots_of_lines, method = list("angled.boxes"))
```
-## `patchwork` package
-
-Great for combining plots together
-
-Also check out the [`patchwork` package](https://patchwork.data-imaginist.com/)
-```{r, out.width= "50%", fig.align='center'}
-#install.packages("patchwork")
-library(patchwork)
-(plt1 + plt2)/plt2
-
-```
diff --git a/modules/Data_Visualization/Data_Visualization.html b/modules/Data_Visualization/Data_Visualization.html
index 23e690b4..b0827b9a 100644
--- a/modules/Data_Visualization/Data_Visualization.html
+++ b/modules/Data_Visualization/Data_Visualization.html
@@ -311,23 +311,25 @@
Data to plot
-
Type ?er_CO_statewide for more information.
+
Letβs plot the CO heat-related ER visits dataset weβve been working with. First, weβll only consider data from Boulder county.
Is the data in tidy? Is it in long format?
-
er_state <- er_CO_statewide
+
er <-
+ read_csv("https://daseh.org/data/CO_ER_heat_visits.csv")
+er_Boulder <- er %>% filter(county == "Boulder")
-head(er_state)
plt1 <- ggplot(er_Boulder, aes(x = year, y = rate)) +
geom_point()
-plt2 <- ggplot(er_state, aes(x = year, y = rate)) +
+plt2 <- ggplot(er_Boulder, aes(x = year, y = rate)) +
geom_line()
plt1 # fig.show = "hold" makes plots appear
plt2 # next to one another in the chunk settings
There are also size, color, alpha, and linetype arguments.
-
ggplot(er_state, aes(x = year, y = rate)) +
+
ggplot(er_Boulder, aes(x = year, y = rate)) +
geom_point(size = 5, color = "green", alpha = 0.5) +
geom_line(size = 0.8, color = "blue", linetype = 2) +
theme_dark()
-
+
More themes!
@@ -510,18 +515,18 @@
-
Adding labels
+
Adding labels
The labs() function can help you add or modify titles on your plot. The title argument specifies the title. The x argument specifies the x axis label. The y argument specifies the y axis label.
-
ggplot(er_state, aes(x = year, y = rate)) +
+
ggplot(er_Boulder, aes(x = year, y = rate)) +
geom_point(size = 5, color = "red", alpha = 0.5) +
geom_line(size = 0.8, color = "brown", linetype = 2) +
- labs(title = "My plot of Heat-Related ER Visits in CO",
+ labs(title = "Heat-Related ER Visits:Boulder",
x = "Year",
y = "Age-adjusted Visit Rate")
-
+
@@ -543,21 +548,17 @@
-
Changing axis: specifying axis scale
+
Changing axis: specifying axis scale
scale_x_continuous() and scale_y_continuous() can change how the axis is plotted. Can use the breaks argument to specify how you want the axis ticks.
plot_scale <- ggplot(er_Boulder, aes(x = year, y = rate)) +
+ geom_point(size = 5, color = "green", alpha = 0.5) +
geom_line(size = 0.8, color = "blue", linetype = 2) +
scale_x_continuous(breaks = seq(from = 2011, to = 2022, by = 1))
plot_scale
-
+
@@ -581,17 +582,17 @@
-
Modifying plot objects
+
Modifying plot objects
You can add to a plot object to make changes! Note that we can save our plots as an object like plt1 below. And now if we reference plt1 again our plot will print out!
-
plt1 <- ggplot(er_state, aes(x = year, y = rate,)) +
- geom_point(size = 5, color = "green", alpha = 0.5) +geom_line(size = 0.8, color = "blue", linetype = 2) +
- labs(title = "My plot of Heat-Related ER Visits in CO", x = "Year", y = "Age-adjusted Visit Rate")
+
plt1 <- ggplot(er_Boulder, aes(x = year, y = rate,)) +
+ geom_point(size = 5, color = "green", alpha = 0.5) +geom_line(size = 0.8, color = "blue", linetype = 2) +
+ labs(title = "Heat-Related ER Visits:Boulder", x = "Year", y = "Age-adjusted Visit Rate")
plt1 + theme_minimal()
Letβs talk additional tricks and tips for making ggplots!
-
We are going to use some other data about ER visits that has to do with gender. Note that gender was recorded as binary, which we know isnβt really accurate. This is something you might encounter. Please see this article about ways to measure gender in a more inclusive way: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6526522/.
-
-
Tips - Color vs Fill
+
Tips - Color vs Fill
color is needed for points and lines
fill is generally needed for boxes and bars
-
er_visits_gender <- CO_heat_ER_bygender
-ggplot(er_visits_gender, aes(x = gender,
- y = rate,
- color = gender)) + #color creates an outline
+
ggplot(er_visits_4, aes(x = county,
+ y = visits,
+ color = county)) + #color creates an outline
geom_boxplot()
-ggplot(er_visits_gender, aes(x = gender,
+ggplot(er_visits_4, aes(x = county,
y = rate,
- fill = gender)) + # fills the boxplot
+ fill = county)) + # fills the boxplot
geom_boxplot()
-
+
Tip - Good idea to add jitter layer to top of box plots
Can add width argument to make the jitter more narrow.
-
ggplot(er_visits_gender, aes(x = gender,
+
ggplot(er_visits_4, aes(x = county,
y = rate,
- fill = gender)) +
+ fill = county)) +
geom_boxplot() +
geom_jitter(width = .06)
-
+
Tip - be careful about colors for color vision deficiency
scale_fill_viridis_d() for discrete /categorical data scale_fill_viridis_c() for continuous data
-
ggplot(er_visits_gender, aes(x = gender,
+
ggplot(er_visits_4, aes(x = county,
y = rate,
- fill = gender)) +
+ fill = county)) +
geom_boxplot() +
geom_jitter(width = .06) +
scale_fill_viridis_d()
You can change look of each layer separately. Note the arguments like linetype and alpha that allow us to change the opacity of the points and style of the line respectively.
-
ggplot(er_state, aes(x = year, y = rate)) +
+
ggplot(er_Boulder, aes(x = year, y = rate)) +
geom_point(size = 5, color = "red", alpha = 0.5) +
geom_line(size = 0.8, color = "black", linetype = 2)
-
+
linetype can be given as a number. See the docs for what numbers correspond to what linetype!
@@ -1231,42 +1255,42 @@
You can change the look of whole plot - specific elements, too - like changing font and font size - or even more fonts
-
ggplot(er_state, aes(x = year, y = rate)) +
+
ggplot(er_Boulder, aes(x = year, y = rate)) +
geom_point(size = 5, color = "green", alpha = 0.5) +
geom_line(size = 0.8, color = "blue", linetype = 2) +
theme_bw() +
theme(text=element_text(size=16, family="Comic Sans MS"))
-
+
-
Adding labels line break
+
Adding labels line break
Line breaks can be specified using \n within the labs() function to have a label with multiple lines.
-
ggplot(er_state, aes(x = year, y = rate)) +
+
ggplot(er_Boulder, aes(x = year, y = rate)) +
geom_point(size = 5, color = "red", alpha = 0.5) +
geom_line(size = 0.8, color = "brown", linetype = 2) +
- labs(title = "My plot of Heat-Related ER Visits in CO: \n age-adjusted visit rate by year",
+ labs(title = "Heat-Related ER Visits in Boulder Co.: \n age-adjusted visit rate by year",
x = "Year",
y = "Age-adjusted Visit Rate")
-
+
Changing axis: specifying axis limits
xlim() and ylim() can specify the limits for each axis
-
ggplot(er_state, aes(x = year, y = rate)) +
+
ggplot(er_Boulder, aes(x = year, y = rate)) +
geom_point(size = 5, color = "green", alpha = 0.5) +
geom_line(size = 0.8, color = "blue", linetype = 2) +
- labs(title = "My plot of Heat-Related ER Visits in CO",
+ labs(title = "Heat-Related ER Visits in Boulder Co.",
x = "Year",
y = "Age-adjusted Visit Rate") +
ylim(0, max(pull(er_visits_4, rate)))
-
+
-
theme() function: moving (or removing) legend
+
theme() function: moving (or removing) legend
If specifying position - use: “top”, “bottom”, “right”, “left”, “none”
However, if can be helpful if your plot is getting stretched to accommodate plotting an outlier. You can always say in the figure legend what you removed.
-
-
+
diff --git a/modules/Data_Visualization/Data_Visualization.pdf b/modules/Data_Visualization/Data_Visualization.pdf
index 52a23517..03a127b4 100644
Binary files a/modules/Data_Visualization/Data_Visualization.pdf and b/modules/Data_Visualization/Data_Visualization.pdf differ
diff --git a/modules/Data_Visualization/lab/Data_Visualization_Lab.Rmd b/modules/Data_Visualization/lab/Data_Visualization_Lab.Rmd
index 6ab57c68..39d8aad7 100644
--- a/modules/Data_Visualization/lab/Data_Visualization_Lab.Rmd
+++ b/modules/Data_Visualization/lab/Data_Visualization_Lab.Rmd
@@ -17,30 +17,24 @@ Load the libraries
library(readr)
library(ggplot2)
library(dplyr)
-library(dasehr)
```
-Open the Nitrate exposure via WA public waterways data from the `dasehr` package.
-
-(You can also access it at the link www.daseh.org/data/Nitrate_Exposure_for_WA_Public_Water_Systems_byquarter_data.csv)
-
-Then, use the provided code to compute a data frame `nitrate` with aggregate summary of exposure level: average exposed population (`pop_exposed_to_exceedances`) for each year (`year`).
+Load the CalEnviroScreen data from the link www.daseh.org/data/CalEnviroScreen_data.csv) and subset it so that you only have data from Fresno, Merced, Placer, Sonoma, and Yolo counties.
```{r}
-
-nitrate_agg <- nitrate %>%
- group_by(year) %>%
- summarise(exposed_pop_avg = mean(pop_exposed_to_exceedances))
-
-nitrate_agg
+ces <- read_csv("https://daseh.org/data/CalEnviroScreen_data.csv")
+ces_sub <- ces %>% filter(CaliforniaCounty == c("Fresno", "Merced", "Placer", "Sonoma", "Yolo"))
```
### 1.1
-Use `ggplot2` package make plot of average exposed population (`exposed_pop_avg`; y-axis) for each year (`year`; x-axis). You can use lines layer (`+ geom_line()`) or points layer (`+ geom_point()`), or both!
+Use the `ggplot2` package to make a plot of how diesel particulate concentration (`DieselPM`; y-axis) is associated with traffic density values (`Traffic`; x-axis). You can use lines layer (`+ geom_line()`) or points layer (`+ geom_point()`), or both!
Assign the plot to variable `my_plot`. Type `my_plot` in the console to have it displayed.
+`DieselPM`: Diesel PM emissions from on-road and non-road sources
+`Traffic`: Traffic density in vehicle-kilometers per hour per road length, within 150 meters of the census tract boundary
+
```
# General format
ggplot(???, aes(x = ???, y = ???)) +
@@ -62,7 +56,8 @@ ggplot(???, aes(x = ???, y = ???)) +
### 1.3
-Use the `scale_x_continuous()` function to plot the x axis with the following breaks `c(1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015, 2017, 2019)`.
+Use the `scale_x_continuous()` function to plot the x axis with the following breaks `c(250, 750, 1250, 1750, 2250)`.
+
```
# General format
@@ -92,7 +87,10 @@ my_plot + theme_bw()
### P.1
-Create a boxplot (with the `geom_boxplot()` function) using the `nitrate` data, where `quarter` is plotted on the x axis and `pop_on_sampled_PWS` is plotted on the y axis.
+Create a boxplot (with the `geom_boxplot()` function) using the `ces_sub` data, where `CaliforniaCounty` is plotted on the x axis and `DrinkingWater` is plotted on the y axis.
+
+`DrinkingWater`: Drinking water contaminant index for selected contaminants. A higher value means drinking water contains a greater volume of contaminants.
+
```{r P1response}
@@ -102,21 +100,10 @@ Create a boxplot (with the `geom_boxplot()` function) using the `nitrate` data,
# Part 2
### 2.1
+Let's look at the plot of traffic density and diesel particulate matter again,
-Use the provided code to compute a data frame `nitrate_agg_2` with aggregate summary of WA Nitrate data: population exposed to less than 10 ug/L of nitrate in the water (sum of `pop_0-3ug/L`, `pop_>3-5ug/L`, and `pop_>5-10ug/L`) -- separately for each year (`year`) and for each quarter (`quarter`.
-
-```{r}
-
-nitrate_agg_2 <- nitrate %>%
- group_by(year, quarter) %>%
- summarise(pop_less_than_10ug_perL = sum(`pop_0-3ug/L`, `pop_>3-5ug/L`, `pop_>5-10ug/L`))
-
-nitrate_agg_2
-```
-
-### 2.2
+Use `ggplot2` package make plot of how diesel particulate concentration (`DieselPM`; y-axis) is associated with traffic density values (`Traffic`; x-axis), where each county (`CaliforniaCounty`) has a different color (hint: use `color = type` in mapping).
-Use `ggplot2` package to make a plot showing trajectories of total population exposed to less than 10 ug/L of nitrate (`pop_less_than_10ug_perL`; y-axis) over year (`year`; x-axis), where each quarter type has a different color (hint: use `color = type` in mapping).
```
# General format
@@ -129,25 +116,26 @@ ggplot(???, aes(
geom_point()
```
-```{r 2.2response}
+```{r 2.1response}
```
-### 2.3
+### 2.2
+
+Redo the above plot by adding a faceting (`+ facet_wrap( ~ CaliforniaCounty, ncol = 3)`) to have data for quarter in a separate plot panel.
-Redo the above plot by adding a faceting (`+ facet_wrap( ~ quarter, ncol = 2)`) to have data for quarter in a separate plot panel.
Assign the new plot as an object called `facet_plot`.
-```{r 2.3response}
+```{r 2.2response}
```
-### 2.4
+### 2.3
Observe what happens when you remove either `geom_line()` OR `geom_point()` from one of your plots above.
-```{r 2.4response}
+```{r 2.3response}
```
@@ -156,7 +144,8 @@ Observe what happens when you remove either `geom_line()` OR `geom_point()` from
### P.2
-Modify `facet_plot` to remove the legend (hint use `theme()` and the `legend.position` argument) and change the names of the axis titles to be "Population exposed to less than 10 ug/L of nitrate in water" for the y axis and "Year" for the x axis.
+Modify `facet_plot` to remove the legend (hint use `theme()` and the `legend.position` argument) and change the names of the axis titles to be "Diesel particulate matter" for the y axis and "Traffic density" for the x axis.
+
```{r P.2response}
diff --git a/modules/Data_Visualization/lab/Data_Visualization_Lab.html b/modules/Data_Visualization/lab/Data_Visualization_Lab.html
index 110516d4..7b9b76af 100644
--- a/modules/Data_Visualization/lab/Data_Visualization_Lab.html
+++ b/modules/Data_Visualization/lab/Data_Visualization_Lab.html
@@ -170,34 +170,23 @@
Open the Nitrate exposure via WA public waterways data from the dasehr package.
-
(You can also access it at the link www.daseh.org/data/Nitrate_Exposure_for_WA_Public_Water_Systems_byquarter_data.csv)
-
Then, use the provided code to compute a data frame nitrate with aggregate summary of exposure level: average exposed population (pop_exposed_to_exceedances) for each year (year).
Load the CalEnviroScreen data from the link www.daseh.org/data/CalEnviroScreen_data.csv) and subset it so that you only have data from Fresno, Merced, Placer, Sonoma, and Yolo counties.
+
ces <- read_csv("https://daseh.org/data/CalEnviroScreen_data.csv")
+
## Rows: 8035 Columns: 67
+## ββ Column specification ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
+## Delimiter: ","
+## chr (3): CaliforniaCounty, ApproxLocation, CES4.0PercRange
+## dbl (64): CensusTract, ZIP, Longitude, Latitude, CES4.0Score, CES4.0Percenti...
+##
+## βΉ Use `spec()` to retrieve the full column specification for this data.
+## βΉ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Use ggplot2 package make plot of average exposed population (exposed_pop_avg; y-axis) for each year (year; x-axis). You can use lines layer (+ geom_line()) or points layer (+ geom_point()), or both!
+
Use the ggplot2 package to make a plot of how diesel particulate concentration (DieselPM; y-axis) is associated with traffic density values (Traffic; x-axis). You can use lines layer (+ geom_line()) or points layer (+ geom_point()), or both!
Assign the plot to variable my_plot. Type my_plot in the console to have it displayed.
+
DieselPM: Diesel PM emissions from on-road and non-road sources Traffic: Traffic density in vehicle-kilometers per hour per road length, within 150 meters of the census tract boundary
# General format
ggplot(???, aes(x = ???, y = ???)) +
??? +
@@ -209,7 +198,7 @@
1.2
1.3
-
Use the scale_x_continuous() function to plot the x axis with the following breaks c(1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015, 2017, 2019).
+
Use the scale_x_continuous() function to plot the x axis with the following breaks c(250, 750, 1250, 1750, 2250).
# General format
my_plot <- my_plot +
scale_x_continuous(breaks = ???)
@@ -225,39 +214,16 @@
1.4
Practice on Your Own!
P.1
-
Create a boxplot (with the geom_boxplot() function) using the nitrate data, where quarter is plotted on the x axis and pop_on_sampled_PWS is plotted on the y axis.
+
Create a boxplot (with the geom_boxplot() function) using the ces_sub data, where CaliforniaCounty is plotted on the x axis and DrinkingWater is plotted on the y axis.
+
DrinkingWater: Drinking water contaminant index for selected contaminants. A higher value means drinking water contains a greater volume of contaminants.
Part 2
2.1
-
Use the provided code to compute a data frame nitrate_agg_2 with aggregate summary of WA Nitrate data: population exposed to less than 10 ug/L of nitrate in the water (sum of pop_0-3ug/L, pop_>3-5ug/L, and pop_>5-10ug/L) β separately for each year (year) and for each quarter (quarter.
Use ggplot2 package to make a plot showing trajectories of total population exposed to less than 10 ug/L of nitrate (pop_less_than_10ug_perL; y-axis) over year (year; x-axis), where each quarter type has a different color (hint: use color = type in mapping).
+
Letβs look at the plot of traffic density and diesel particulate matter again,
+
Use ggplot2 package make plot of how diesel particulate concentration (DieselPM; y-axis) is associated with traffic density values (Traffic; x-axis), where each county (CaliforniaCounty) has a different color (hint: use color = type in mapping).
# General format
ggplot(???, aes(
x = ???,
@@ -267,13 +233,13 @@
2.2
geom_line() +
geom_point()
-
-
2.3
-
Redo the above plot by adding a faceting (+ facet_wrap( ~ quarter, ncol = 2)) to have data for quarter in a separate plot panel.
+
+
2.2
+
Redo the above plot by adding a faceting (+ facet_wrap( ~ CaliforniaCounty, ncol = 3)) to have data for quarter in a separate plot panel.
Assign the new plot as an object called facet_plot.
-
-
2.4
+
+
2.3
Observe what happens when you remove either geom_line() OR geom_point() from one of your plots above.
@@ -281,7 +247,7 @@
2.4
Practice on Your Own!
P.2
-
Modify facet_plot to remove the legend (hint use theme() and the legend.position argument) and change the names of the axis titles to be βPopulation exposed to less than 10 ug/L of nitrate in waterβ for the y axis and βYearβ for the x axis.
+
Modify facet_plot to remove the legend (hint use theme() and the legend.position argument) and change the names of the axis titles to be βDiesel particulate matterβ for the y axis and βTraffic densityβ for the x axis.
P.3
diff --git a/modules/Data_Visualization/lab/Data_Visualization_Lab_Key.Rmd b/modules/Data_Visualization/lab/Data_Visualization_Lab_Key.Rmd
index f0df3550..d0cbd429 100644
--- a/modules/Data_Visualization/lab/Data_Visualization_Lab_Key.Rmd
+++ b/modules/Data_Visualization/lab/Data_Visualization_Lab_Key.Rmd
@@ -17,30 +17,24 @@ Load the libraries
library(readr)
library(ggplot2)
library(dplyr)
-library(dasehr)
```
-Open the Nitrate exposure via WA public waterways data from the `dasehr` package.
-
-(You can also access it at the link www.daseh.org/data/Nitrate_Exposure_for_WA_Public_Water_Systems_byquarter_data.csv)
-
-Then, use the provided code to compute a data frame `nitrate` with aggregate summary of exposure level: average exposed population (`pop_exposed_to_exceedances`) for each year (`year`).
+Load the CalEnviroScreen data from the link www.daseh.org/data/CalEnviroScreen_data.csv) and subset it so that you only have data from Fresno, Merced, Placer, Sonoma, and Yolo counties.
```{r}
-
-nitrate_agg <- nitrate %>%
- group_by(year) %>%
- summarise(exposed_pop_avg = mean(pop_exposed_to_exceedances))
-
-nitrate_agg
+ces <- read_csv("https://daseh.org/data/CalEnviroScreen_data.csv")
+ces_sub <- ces %>% filter(CaliforniaCounty == c("Fresno", "Merced", "Placer", "Sonoma", "Yolo"))
```
### 1.1
-Use `ggplot2` package make plot of average exposed population (`exposed_pop_avg`; y-axis) for each year (`year`; x-axis). You can use lines layer (`+ geom_line()`) or points layer (`+ geom_point()`), or both!
+Use the `ggplot2` package to make a plot of how diesel particulate concentration (`DieselPM`; y-axis) is associated with traffic density values (`Traffic`; x-axis). You can use lines layer (`+ geom_line()`) or points layer (`+ geom_point()`), or both!
Assign the plot to variable `my_plot`. Type `my_plot` in the console to have it displayed.
+`DieselPM`: Diesel PM emissions from on-road and non-road sources
+`Traffic`: Traffic density in vehicle-kilometers per hour per road length, within 150 meters of the census tract boundary
+
```
# General format
ggplot(???, aes(x = ???, y = ???)) +
@@ -51,7 +45,7 @@ ggplot(???, aes(x = ???, y = ???)) +
```{r 1.1response}
my_plot <-
- ggplot(nitrate_agg, aes(x = year, y = exposed_pop_avg)) +
+ ggplot(ces_sub, aes(x = Traffic, y = DieselPM)) +
geom_line() +
geom_point()
@@ -65,9 +59,9 @@ my_plot
```{r 1.2response}
my_plot <- my_plot +
labs(
- x = "Year",
- y = "Average population exposed",
- title = "Average population exposed to excess nitrate in public water sources, 1999-2020"
+ x = "Traffic density index",
+ y = "Diesel particulate matter",
+ title = "Relationship between traffic density and diesel particulate matter"
)
my_plot
@@ -75,7 +69,8 @@ my_plot
### 1.3
-Use the `scale_x_continuous()` function to plot the x axis with the following breaks `c(1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015, 2017, 2019)`.
+Use the `scale_x_continuous()` function to plot the x axis with the following breaks `c(250, 750, 1250, 1750, 2250)`.
+
```
# General format
@@ -86,7 +81,7 @@ my_plot <- my_plot +
```{r 1.3response}
my_plot <- my_plot +
scale_x_continuous(
- breaks = c(1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015, 2017, 2019)
+ breaks = c(250, 750, 1250, 1750, 2250)
)
my_plot
@@ -114,11 +109,14 @@ my_plot + theme_void()
### P.1
-Create a boxplot (with the `geom_boxplot()` function) using the `nitrate` data, where `quarter` is plotted on the x axis and `pop_on_sampled_PWS` is plotted on the y axis.
+Create a boxplot (with the `geom_boxplot()` function) using the `ces_sub` data, where `CaliforniaCounty` is plotted on the x axis and `DrinkingWater` is plotted on the y axis.
+
+`DrinkingWater`: Drinking water contaminant index for selected contaminants. A higher value means drinking water contains a greater volume of contaminants.
+
```{r P1response}
-nitrate %>%
- ggplot(aes(x = quarter, y = pop_on_sampled_PWS)) +
+ces_sub %>%
+ ggplot(aes(x = CaliforniaCounty, y = DrinkingWater)) +
geom_boxplot()
```
@@ -126,21 +124,10 @@ nitrate %>%
# Part 2
### 2.1
+Let's look at the plot of traffic density and diesel particulate matter again,
-Use the provided code to compute a data frame `nitrate_agg_2` with aggregate summary of WA Nitrate data: population exposed to less than 10 ug/L of nitrate in the water (sum of `pop_0-3ug/L`, `pop_>3-5ug/L`, and `pop_>5-10ug/L`) -- separately for each year (`year`) and for each quarter (`quarter`.
-
-```{r}
-
-nitrate_agg_2 <- nitrate %>%
- group_by(year, quarter) %>%
- summarise(pop_less_than_10ug_perL = sum(`pop_0-3ug/L`, `pop_>3-5ug/L`, `pop_>5-10ug/L`))
-
-nitrate_agg_2
-```
-
-### 2.2
+Use `ggplot2` package make plot of how diesel particulate concentration (`DieselPM`; y-axis) is associated with traffic density values (`Traffic`; x-axis), where each county (`CaliforniaCounty`) has a different color (hint: use `color = type` in mapping).
-Use `ggplot2` package to make a plot showing trajectories of total population exposed to less than 10 ug/L of nitrate (`pop_less_than_10ug_perL`; y-axis) over year (`year`; x-axis), where each quarter type has a different color (hint: use `color = type` in mapping).
```
# General format
@@ -153,41 +140,42 @@ ggplot(???, aes(
geom_point()
```
-```{r 2.2response}
-ggplot(nitrate_agg_2, aes(
- x = year,
- y = pop_less_than_10ug_perL,
- color = quarter
+```{r 2.1response}
+ggplot(ces_sub, aes(
+ x = Traffic,
+ y = DieselPM,
+ color = CaliforniaCounty
)) +
geom_line() +
geom_point()
```
-### 2.3
+### 2.2
+
+Redo the above plot by adding a faceting (`+ facet_wrap( ~ CaliforniaCounty, ncol = 3)`) to have data for quarter in a separate plot panel.
-Redo the above plot by adding a faceting (`+ facet_wrap( ~ quarter, ncol = 2)`) to have data for quarter in a separate plot panel.
Assign the new plot as an object called `facet_plot`.
-```{r 2.3response}
+```{r 2.2response}
-facet_plot <- ggplot(nitrate_agg_2, aes(
- x = year,
- y = pop_less_than_10ug_perL,
- color = quarter
+facet_plot <- ggplot(ces_sub, aes(
+ x = Traffic,
+ y = DieselPM,
+ color = CaliforniaCounty
)) +
geom_line() +
geom_point() +
- facet_wrap(~quarter, ncol = 2)
+ facet_wrap(~CaliforniaCounty, ncol = 3)
facet_plot
```
-### 2.4
+### 2.3
Observe what happens when you remove either `geom_line()` OR `geom_point()` from one of your plots above.
-```{r 2.4response}
+```{r 2.3response}
# These elements are removed from the plot, like layers
```
@@ -196,14 +184,15 @@ Observe what happens when you remove either `geom_line()` OR `geom_point()` from
### P.2
-Modify `facet_plot` to remove the legend (hint use `theme()` and the `legend.position` argument) and change the names of the axis titles to be "Population exposed to less than 10 ug/L of nitrate in water" for the y axis and "Year" for the x axis.
+Modify `facet_plot` to remove the legend (hint use `theme()` and the `legend.position` argument) and change the names of the axis titles to be "Diesel particulate matter" for the y axis and "Traffic density" for the x axis.
+
```{r P.2response}
facet_plot <- facet_plot +
theme(legend.position = "none") +
labs(
- y = "Population exposed to less than 10 ug/L of nitrate in water",
- x = "Year"
+ y = "Diesel particulate matter",
+ x = "Traffic density"
)
facet_plot
diff --git a/modules/Data_Visualization/lab/Data_Visualization_Lab_Key.html b/modules/Data_Visualization/lab/Data_Visualization_Lab_Key.html
index b355285f..967b9e5a 100644
--- a/modules/Data_Visualization/lab/Data_Visualization_Lab_Key.html
+++ b/modules/Data_Visualization/lab/Data_Visualization_Lab_Key.html
@@ -170,72 +170,61 @@
Open the Nitrate exposure via WA public waterways data from the dasehr package.
-
(You can also access it at the link www.daseh.org/data/Nitrate_Exposure_for_WA_Public_Water_Systems_byquarter_data.csv)
-
Then, use the provided code to compute a data frame nitrate with aggregate summary of exposure level: average exposed population (pop_exposed_to_exceedances) for each year (year).
Load the CalEnviroScreen data from the link www.daseh.org/data/CalEnviroScreen_data.csv) and subset it so that you only have data from Fresno, Merced, Placer, Sonoma, and Yolo counties.
+
ces <- read_csv("https://daseh.org/data/CalEnviroScreen_data.csv")
+
## Rows: 8035 Columns: 67
+## ββ Column specification ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
+## Delimiter: ","
+## chr (3): CaliforniaCounty, ApproxLocation, CES4.0PercRange
+## dbl (64): CensusTract, ZIP, Longitude, Latitude, CES4.0Score, CES4.0Percenti...
+##
+## βΉ Use `spec()` to retrieve the full column specification for this data.
+## βΉ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Use ggplot2 package make plot of average exposed population (exposed_pop_avg; y-axis) for each year (year; x-axis). You can use lines layer (+ geom_line()) or points layer (+ geom_point()), or both!
+
Use the ggplot2 package to make a plot of how diesel particulate concentration (DieselPM; y-axis) is associated with traffic density values (Traffic; x-axis). You can use lines layer (+ geom_line()) or points layer (+ geom_point()), or both!
Assign the plot to variable my_plot. Type my_plot in the console to have it displayed.
+
DieselPM: Diesel PM emissions from on-road and non-road sources Traffic: Traffic density in vehicle-kilometers per hour per road length, within 150 meters of the census tract boundary
# General format
ggplot(???, aes(x = ???, y = ???)) +
??? +
???
βUpdateβ your plot by adding a title and changing the x and y axis titles.
my_plot <- my_plot +
labs(
- x = "Year",
- y = "Average population exposed",
- title = "Average population exposed to excess nitrate in public water sources, 1999-2020"
+ x = "Traffic density index",
+ y = "Diesel particulate matter",
+ title = "Relationship between traffic density and diesel particulate matter"
)
my_plot
-
+
1.3
-
Use the scale_x_continuous() function to plot the x axis with the following breaks c(1999, 2001, 2003, 2005, 2007, 2009, 2011, 2013, 2015, 2017, 2019).
+
Use the scale_x_continuous() function to plot the x axis with the following breaks c(250, 750, 1250, 1750, 2250).
# General format
my_plot <- my_plot +
scale_x_continuous(breaks = ???)
Create a boxplot (with the geom_boxplot() function) using the nitrate data, where quarter is plotted on the x axis and pop_on_sampled_PWS is plotted on the y axis.
Create a boxplot (with the geom_boxplot() function) using the ces_sub data, where CaliforniaCounty is plotted on the x axis and DrinkingWater is plotted on the y axis.
+
DrinkingWater: Drinking water contaminant index for selected contaminants. A higher value means drinking water contains a greater volume of contaminants.
## Warning: Removed 1 row containing non-finite outside the scale range
+## (`stat_boxplot()`).
+
Part 2
2.1
-
Use the provided code to compute a data frame nitrate_agg_2 with aggregate summary of WA Nitrate data: population exposed to less than 10 ug/L of nitrate in the water (sum of pop_0-3ug/L, pop_>3-5ug/L, and pop_>5-10ug/L) β separately for each year (year) and for each quarter (quarter.
Use ggplot2 package to make a plot showing trajectories of total population exposed to less than 10 ug/L of nitrate (pop_less_than_10ug_perL; y-axis) over year (year; x-axis), where each quarter type has a different color (hint: use color = type in mapping).
+
Letβs look at the plot of traffic density and diesel particulate matter again,
+
Use ggplot2 package make plot of how diesel particulate concentration (DieselPM; y-axis) is associated with traffic density values (Traffic; x-axis), where each county (CaliforniaCounty) has a different color (hint: use color = type in mapping).
# General format
ggplot(???, aes(
x = ???,
@@ -303,33 +271,33 @@
2.2
)) +
geom_line() +
geom_point()
-
ggplot(nitrate_agg_2, aes(
- x = year,
- y = pop_less_than_10ug_perL,
- color = quarter
+
ggplot(ces_sub, aes(
+ x = Traffic,
+ y = DieselPM,
+ color = CaliforniaCounty
)) +
geom_line() +
geom_point()
-
+
-
-
2.3
-
Redo the above plot by adding a faceting (+ facet_wrap( ~ quarter, ncol = 2)) to have data for quarter in a separate plot panel.
+
+
2.2
+
Redo the above plot by adding a faceting (+ facet_wrap( ~ CaliforniaCounty, ncol = 3)) to have data for quarter in a separate plot panel.
Assign the new plot as an object called facet_plot.
-
facet_plot <- ggplot(nitrate_agg_2, aes(
- x = year,
- y = pop_less_than_10ug_perL,
- color = quarter
+
Observe what happens when you remove either geom_line() OR geom_point() from one of your plots above.
# These elements are removed from the plot, like layers
@@ -338,16 +306,16 @@
2.4
Practice on Your Own!
P.2
-
Modify facet_plot to remove the legend (hint use theme() and the legend.position argument) and change the names of the axis titles to be βPopulation exposed to less than 10 ug/L of nitrate in waterβ for the y axis and βYearβ for the x axis.
+
Modify facet_plot to remove the legend (hint use theme() and the legend.position argument) and change the names of the axis titles to be βDiesel particulate matterβ for the y axis and βTraffic densityβ for the x axis.
facet_plot <- facet_plot +
theme(legend.position = "none") +
labs(
- y = "Population exposed to less than 10 ug/L of nitrate in water",
- x = "Year"
+ y = "Diesel particulate matter",
+ x = "Traffic density"
)
facet_plot
diff --git a/modules/Esquisse_Data_Visualization/Esquisse_Data_Visualization.Rmd b/modules/Esquisse_Data_Visualization/Esquisse_Data_Visualization.Rmd
index ba9cddb7..cb1bc273 100644
--- a/modules/Esquisse_Data_Visualization/Esquisse_Data_Visualization.Rmd
+++ b/modules/Esquisse_Data_Visualization/Esquisse_Data_Visualization.Rmd
@@ -10,6 +10,7 @@ output:
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(here)
+library(tidyverse)
```
## Esquisse Package
@@ -30,12 +31,23 @@ It's super **nifty**!
knitr::include_graphics("https://c.tenor.com/DNUSO9MjrTEAAAAC/bob-ross.gif")
```
+## First, get some data..
+
+We can use the CO heat-related ER visits dataset. This dataset contains information about the number and rate of visits for heat-related illness to ERs in Colorado from 2011-2022, adjusted for age.
+
+```{r message=FALSE}
+er <-
+ read_csv("https://daseh.org/data/CO_ER_heat_visits.csv")
+
+head(er)
+```
+
## Starting a plot
Using the `esquisser()` function you can start creating a plot for a `data.frame` or `tibble`. That's it!
```{r, eval = FALSE}
-esquisser(mtcars)
+esquisser(er)
```
```{r, fig.alt="starting a plot", out.width = "90%", echo = FALSE, fig.align='center'}
@@ -45,14 +57,14 @@ knitr::include_graphics("images/start_a_plot.png")
## Show the plot in the browser
```{r, eval = FALSE}
-esquisse::esquisser(iris, viewer = "browser")
+esquisse::esquisser(er, viewer = "browser")
```
## Select Variables
To select variables you can drag and drop variables to the respective axis that you would like the variable to be plotted on.
-```{r, fig.alt="select variables", out.width = "100%", echo = FALSE, fig.align='center'}
+```{r, fig.alt="select variables", out.width = "70%", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/variables.gif")
```
@@ -60,7 +72,7 @@ knitr::include_graphics("images/variables.gif")
To select variables you can drag and drop variables to the respective axis that you would like the variable to be plotted on.
-```{r, fig.alt="select variables", out.width = "100%", echo = FALSE, fig.align='center'}
+```{r, fig.alt="select variables", out.width = "70%", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/get_code.gif")
```
@@ -68,7 +80,7 @@ knitr::include_graphics("images/get_code.gif")
`esquisse` automatically assumes a plot type, but you might want to change this.
-```{r, fig.alt="change plot type", out.width = "100%", echo = FALSE, fig.align='center'}
+```{r, fig.alt="change plot type", out.width = "70%", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/change_type_short.gif")
```
@@ -76,7 +88,7 @@ knitr::include_graphics("images/change_type_short.gif")
Facets create multiple plots based on the different values of a variable.
-```{r, fig.alt="add facets", out.width = "100%", echo = FALSE, fig.align='center'}
+```{r, fig.alt="add facets", out.width = "70%", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/facet.gif")
```
@@ -84,7 +96,7 @@ knitr::include_graphics("images/facet.gif")
Sometimes it is useful to change the way points are plotted so that size represents a variable. This can especially be helpful if you need your plot to be black and white.
-```{r, fig.alt="add color", out.width = "100%", echo = FALSE, fig.align='center'}
+```{r, fig.alt="add color", out.width = "70%", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/size.gif")
```
@@ -93,32 +105,24 @@ knitr::include_graphics("images/size.gif")
For plots with points use the color region to change coloring according to a variable.
(use "fill" for bar plots)
-```{r, fig.alt="add color", out.width = "100%", echo = FALSE, fig.align='center'}
+```{r, fig.alt="add color", out.width = "70%", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/color.gif")
```
## Appearance
-You can change the overall appearance with the appearance tab.
+You can change the overall appearance with "Geometries" and "Theme".
-```{r, fig.alt="change overall appearance", out.width = "100%", echo = FALSE, fig.align='center'}
+```{r, fig.alt="change overall appearance", out.width = "70%", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/appearance.gif")
```
-## Smooth Lines
-
-Especially when you have a scatter plot, it can be helpful to add a smooth/trend line.
-
-```{r, fig.alt="add smooth line", out.width = "100%", echo = FALSE, fig.align='center'}
-knitr::include_graphics("images/smooth.gif")
-```
-
## Change titles
-To change titles on your plot, use the titles tab.
+To change titles on your plot, use the "Labels & Titles" tab.
-```{r, fig.alt="change titles", out.width = "100%", echo = FALSE, fig.align='center'}
-knitr::include_graphics("images/titles.gif")
+```{r, fig.alt="change titles", out.width = "70%", echo = FALSE, fig.align='center'}
+knitr::include_graphics("images/title.gif")
```
## View data
@@ -137,19 +141,21 @@ Use the stop button or press ctrl+c to stop the Esquisse app.
_If you don't see the stop button, you need to resize your window._
-```{r, fig.alt="Click the stop button to interrupt the Esquisse app.", out.width = "100%", echo = FALSE, fig.align='center'}
+```{r, fig.alt="Click the stop button to interrupt the Esquisse app.", out.width = "50%", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/stop.png")
```
-## Wide & Long Data Example
+## Wide & Long Data ? {.codesmall}
-Let's look at the CO heat-related ER visits dataset again. This time we want to look at only Boulder and Denver counties, and only the visit and year data.
+Let's look at why we might want long data using Esquisse.
```{r message=FALSE}
-library(dplyr)
+library(tidyverse)
er <- read_csv(file =
"https://daseh.org/data/CO_ER_heat_visits.csv")
-long_er <- er %>% filter(county == c("Denver", "Boulder")) %>% select(c("county", "year", "visits"))
+long_er <- er %>%
+ filter(county == c("Denver", "Boulder")) %>%
+ select(c("county", "year", "visits"))
glimpse(long_er)
```
@@ -177,6 +183,16 @@ esquisser(wide_er) # county as x...? Tricky!
esquisser(long_er) #county as x, visit rate as y, year as fill
```
+## GUT CHECK!
+
+Why use Esquisse?
+
+A. Explore your data
+
+B. Get a "head start" on your code
+
+C. Both of these!
+
## Some Alternatives to `esquisse`
* `ggquickeda`: https://smouksassi.github.io/ggquickeda/
@@ -196,6 +212,8 @@ esquisser(long_er) #county as x, visit rate as y, year as fill
π» [Lab](https://daseh.org/modules/Esquisse_Data_Visualization/lab/Esquisse_Data_Visualization_Lab.Rmd)
+π [Day 6 Cheatsheet](https://daseh.org/modules/cheatsheets/Day-6.pdf)
+
```{r, fig.alt="The End", out.width = "50%", echo = FALSE, fig.align='center'}
knitr::include_graphics(here::here("images/the-end-g23b994289_1280.jpg"))
```
diff --git a/modules/Esquisse_Data_Visualization/Esquisse_Data_Visualization.html b/modules/Esquisse_Data_Visualization/Esquisse_Data_Visualization.html
index 7ee6eee8..b9ce2052 100644
--- a/modules/Esquisse_Data_Visualization/Esquisse_Data_Visualization.html
+++ b/modules/Esquisse_Data_Visualization/Esquisse_Data_Visualization.html
@@ -32,3217 +32,129 @@
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+ code span.at { color: #7d9029; } /* Attribute */
+ code span.bn { color: #40a070; } /* BaseN */
+ code span.bu { } /* BuiltIn */
+ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+ code span.ch { color: #4070a0; } /* Char */
+ code span.cn { color: #880000; } /* Constant */
+ code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+ code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+ code span.dt { color: #902000; } /* DataType */
+ code span.dv { color: #40a070; } /* DecVal */
+ code span.er { color: #ff0000; font-weight: bold; } /* Error */
+ code span.ex { } /* Extension */
+ code span.fl { color: #40a070; } /* Float */
+ code span.fu { color: #06287e; } /* Function */
+ code span.im { } /* Import */
+ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+ code span.op { color: #666666; } /* Operator */
+ code span.ot { color: #007020; } /* Other */
+ code span.pp { color: #bc7a00; } /* Preprocessor */
+ code span.sc { color: #4070a0; } /* SpecialChar */
+ code span.ss { color: #bb6688; } /* SpecialString */
+ code span.st { color: #4070a0; } /* String */
+ code span.va { color: #19177c; } /* Variable */
+ code span.vs { color: #4070a0; } /* VerbatimString */
+ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+
+
+
+
@@ -3272,77 +184,90 @@
Itβs super nifty!
+
First, get some data..
+
+
We can use the CO heat-related ER visits dataset. This dataset contains information about the number and rate of visits for heat-related illness to ERs in Colorado from 2011-2022, adjusted for age.
+
+
er <-
+ read_csv("https://daseh.org/data/CO_ER_heat_visits.csv")
+
+head(er)
Using the esquisser() function you can start creating a plot for a data.frame or tibble. Thatβs it!
-
esquisser(mtcars)
+
esquisser(er)
-
+
Show the plot in the browser
-
esquisse::esquisser(iris, viewer = "browser")
+
esquisse::esquisser(er, viewer = "browser")
Select Variables
To select variables you can drag and drop variables to the respective axis that you would like the variable to be plotted on.
-
+
Find code
To select variables you can drag and drop variables to the respective axis that you would like the variable to be plotted on.
-
+
Change plot type
esquisse automatically assumes a plot type, but you might want to change this.
-
+
Add Facets
Facets create multiple plots based on the different values of a variable.
-
+
Add size
Sometimes it is useful to change the way points are plotted so that size represents a variable. This can especially be helpful if you need your plot to be black and white.
-
+
Add color
For plots with points use the color region to change coloring according to a variable. (use “fill” for bar plots)
-
+
Appearance
-
You can change the overall appearance with the appearance tab.
-
-
-
-
Smooth Lines
+
You can change the overall appearance with “Geometries” and “Theme”.
-
Especially when you have a scatter plot, it can be helpful to add a smooth/trend line.
-
-
+
Change titles
-
To change titles on your plot, use the titles tab.
+
To change titles on your plot, use the “Labels & Titles” tab.