The United Nations Food and Agriculture Organization publication, The State of Food Security and Nutrition in the World 2022 (https://www.fao.org/documents/card/en/c/cc0639en) might lead one to the conclusion that it’s an elsewhere problem. That the people who are suffering malnutrition and starvation are “elsewhere”, not in our backyard. For this assignment you will need to take a closer look here at home (the US)
Notes:
1.You will need to locate and source data that reflects food security and nutrition by state broken down by men, women, children and by age groups
Your analysis should demonstrate correlations that exist between level of poverty and food insecurity, malnutrition and starvation.
Your data and analysis should also indicate what happens to the children as they mature into adults. Will they become fully functional citizens or will they require continued support?
You data visualizations need to tell the story for a political audience that you were lobbying to address the issue of food insecurity in the US
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.3 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.4 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.0
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(plotly)
##
## Attaching package: 'plotly'
##
## The following object is masked from 'package:ggplot2':
##
## last_plot
##
## The following object is masked from 'package:stats':
##
## filter
##
## The following object is masked from 'package:graphics':
##
## layout
library(plotly)
library(ggplot2)
library(dplyr)
library(rnaturalearthdata)
foodsecurity_row <- foodsecurity1<- foodsecurity1[-c(1:210), ]
foodsecurity_index <- foodsecurity_row
rownames(foodsecurity_index) <- 1:nrow(foodsecurity_index)
foodsecurity_cat1 <- select(filter(foodsecurity_index, Category == 'All households'),c(Year, Food.secure.percent, Food.insecure.percent, Low.food.security.percent, Very.low.food.security.percent))
x <- foodsecurity_cat1$Year
y1 <- foodsecurity_cat1$Food.insecure.percent
y2 <- foodsecurity_cat1$Low.food.security.percent
y3 <- foodsecurity_cat1$Very.low.food.security.percent
# Create hover text with year, temperature, and rank
text1 <- paste("Year: ", x, "Percent of Households: ", y1)
text2 <- paste("Year: ", x, "Percent of Households: ", y2)
text3 <- paste("Year: ", x, "Percent of Households: ", y3)
# Create the plotly figure
fig <- plot_ly(x = ~x, y = ~y1, type = 'scatter', mode = 'lines+markers', text = text1, hoverinfo = 'text', name = "Total Food Insecuruity") %>%
add_trace(x = ~x, y = ~y2, type = 'scatter', mode = 'lines+markers', text = text2, hoverinfo = 'text', name = "Low Food Security") %>%
add_trace(x = ~x, y = ~y3, type = 'scatter', mode = 'lines+markers', text = text3, hoverinfo = 'text', name = "Very Low Food Security")
# Layout adjustments
fig <- fig %>% layout(
xaxis = list(title = "Year", tickmode = "linear"),
yaxis = list(title = "Percent of Households", range = c(0, max(c(y1, y2, y3)))),
margin = list(b = 100, l = 60, r = 160, t = 80), # Adjust margins for better visibility
height = 500, # Adjust the height of the graph
width = 800, # Adjust the width of the graph
legend = list(x = 1.0, y = .80) # Adjust the legend position
)
## Warning: Specifying width/height in layout() is now deprecated.
## Please specify in ggplotly() or plot_ly()
fig <- fig %>% add_annotations(
text = "FOOD INSECURITY IN ALL U.S. HOUSEHOLDS",
x = 0, xref = "paper",
y = 1.15, yref = "paper", # Adjust the y value to move the title higher
showarrow = FALSE,
font = list(size = 20),
align = "left"
)
fig <- fig %>% add_annotations(
text = "Trends in Food Insecurity in the U.S.",
x = 0, xref = "paper",
y = 1.1, yref = "paper", # Adjust the y value to move the subtitle higher
showarrow = FALSE,
font = list(size = 14),
align = "left",
width = 800 # Set the width parameter to control text wrapping
)
# Display the figure
fig
foodsecurity_cat2 <- filter(foodsecurity_index, Category %in% c("All households", "Race/ethnicity of households"))
foodsecurity_cat2 <- select(foodsecurity_cat2, Year, Category, Subcategory, Food.insecure.percent, Very.low.food.security.percent)
foodsecurity_cat2 %>%
plot_ly(
x = ~Year,
y = ~Food.insecure.percent,
color = ~interaction(Category, Subcategory),
type = 'scatter',
mode = 'lines+markers',
name = ~ifelse(Category == "All households", "All households", paste(Subcategory, sep = " - "))) %>%
layout(
xaxis = list(title = "Year", tickmode = "linear"),
yaxis = list(title = "Percentage of Food Insecurity"),
margin = list(b = 100, l = 60, r = 160, t = 80), # Adjust margins for better visibility
height = 500, # Adjust the height of the graph
width = 810, # Adjust the width of the graph
legend = list(x = .9, y = 1.1) # Adjust the legend position
) %>%
add_annotations(
text = "FOOD INSECURITY BY RACE AND ETHNICITY IN THE U.S.",
x = 0, xref = "paper",
y = 1.15, yref = "paper", # Adjust the y value to move the title higher
showarrow = FALSE,
font = list(size = 20),
align = "left"
) %>%
config(modeBarButtonsToRemove = list('lasso2d', 'select2d'))
## Warning: Specifying width/height in layout() is now deprecated.
## Please specify in ggplotly() or plot_ly()
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
foodsecurity_cat2 %>%
plot_ly(
x = ~Year,
y = ~Very.low.food.security.percent,
color = ~interaction(Category, Subcategory), # Use interaction to combine Category and Subcategory for distinct colors
type = 'scatter',
mode = 'lines+markers',
name = ~ifelse(Category == "All households", "All households", paste(Subcategory, sep = " - "))) %>%
layout(
xaxis = list(title = "Year", tickmode = "linear"),
yaxis = list(title = "Percentage of Food Insecurity"),
margin = list(b = 100, l = 60, r = 160, t = 80),
height = 500,
width = 810,
legend = list(x = .9, y = 1.1)
) %>%
add_annotations(
text = "VERY LOW FOOD SECURITY BY RACE AND ETHNICITY IN THE U.S.",
x = 0, xref = "paper",
y = 1.20, yref = "paper", #
showarrow = FALSE,
font = list(size = 20),
align = "left"
) %>%
add_annotations(
text = "Trends in L owFood Insecurity in U.S. Households by Race and Ethnicity",
x = 0, xref = "paper",
y = 1.12, yref = "paper", # Adjust the y value to move the subtitle higher
showarrow = FALSE,
font = list(size = 14),
align = "left"
) %>%
config(modeBarButtonsToRemove = list('lasso2d', 'select2d')) # Optional: Remove unwanted plotly mode bar buttons
## Warning: Specifying width/height in layout() is now deprecated.
## Please specify in ggplotly() or plot_ly()
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
foodsecurity3 = read.csv("https://raw.githubusercontent.com/Meccamarshall/Data608/main/Story6/edu_emp_dis.csv")
foodsecurity_cat3 <- select(filter(foodsecurity2, Category == 'All households with children'),c(Year, Food.insecure.households.percent, Households.with.food.insecure.children.percent, Households.with.very.low.food.security.among.children.percent))
foodsecurity_cat3 <- rename(foodsecurity_cat3,
"Food Insecurity in Household with Children" = "Food.insecure.households.percent",
"Food Insecurity Among Children" = "Households.with.food.insecure.children.percent",
"Very Low food Security Among Children" = "Households.with.very.low.food.security.among.children.percent"
)
x <- foodsecurity_cat3$Year
y1 <- foodsecurity_cat3$"Food Insecurity in Household with Children"
y2 <- foodsecurity_cat3$"Food Insecurity Among Children"
y3 <- foodsecurity_cat3$"Very Low food Security Among Children"
# Create hover text with year, temperature, and rank
text1 <- paste("Year: ", x, "Percent of Households with Children: ", y1)
text2 <- paste("Year: ", x, "Percent of Households with Children: ", y2)
text3 <- paste("Year: ", x, "Percent of Households with Children: ", y3)
# Create the plotly figure
fig <- plot_ly(x = ~x, y = ~y1, type = 'scatter', mode = 'lines+markers', text = text1, hoverinfo = 'text', name = "Food Insec. in Household w. Children") %>%
add_trace(x = ~x, y = ~y2, type = 'scatter', mode = 'lines+markers', text = text2, hoverinfo = 'text', name = "Food Insec. Among Children") %>%
add_trace(x = ~x, y = ~y3, type = 'scatter', mode = 'lines+markers', text = text3, hoverinfo = 'text', name = "Very Low food Sec. Among Children")
fig <- fig %>% layout(
xaxis = list(title = "Year", tickmode = "linear"),
yaxis = list(title = "Percent of Households with Children", range = c(0, 22)),
margin = list(b = 100, l = 60, r = 160, t = 80),
height = 500,
width = 800,
legend = list(x = .1, y = .8) # Adjust the legend position
)
## Warning: Specifying width/height in layout() is now deprecated.
## Please specify in ggplotly() or plot_ly()
# Add HTML-based annotations for title and subtitle
fig <- fig %>% add_annotations(
text = "FOOD INSEC. IN ALL U.S. HOUSEHOLDS WITH CHILDREN",
x = 0, xref = "paper",
y = 1.15, yref = "paper",
showarrow = FALSE,
font = list(size = 15),
align = "left"
)
fig <- fig %>% add_annotations(
text = "Trends in Food Insecurity in U.S. Households With Children",
x = 0, xref = "paper",
y = 1.12, yref = "paper", # Adjust the y value to move the subtitle higher
showarrow = FALSE,
font = list(size = 14),
align = "left",
width = 700 # Set the width parameter to control text wrapping
)
# Display the figure
fig
## Warning: Can't display both discrete & non-discrete data on same axis
foodsecurity_cat4 <- select(filter(foodsecurity2, Category == 'Race/ethnicity of households'),c(Year, Category, Subcategory, Households.with.food.insecure.children.percent))
foodsecurity_cat4 <- rename(foodsecurity_cat4,
"Food Insecurity Among Children" = "Households.with.food.insecure.children.percent")
foodsecurity_cat4$`Food Insecurity Among Children` <- as.numeric(foodsecurity_cat4$`Food Insecurity Among Children`)
plot_ly(
data = foodsecurity_cat4,
x = ~Year,
y = ~`Food Insecurity Among Children`,
color = ~Subcategory,
type = 'scatter',
mode = 'lines+markers',
text = ~paste("Year: ", Year, "Food Insecurity Among Children: ", `Food Insecurity Among Children`, ""),
hoverinfo = 'text'
) %>%
layout(
title = list(
text = "<b>FOOD INSECURITY AMONG CHILDREN BY RACE AND ETHNICITY IN THE U.S.<b>",
x = -.10 # Adjust the x value to move the title more to the left
),
xaxis = list(title = "Year"),
yaxis = list(title = "Food Insecurity Among Children"),
legend = list(x = 1.00, y = 1),
margin = list(b = 60, l = 60, r = 60, t = 60),
height = 500,
width = 810,
annotations = list(
list(
text = "Food Insecurity among children by race and ethnicity of head of household, 2008 - 2022",
x = 0, y = 1.2,
xref = "paper", yref = "paper",
showarrow = FALSE,
font = list(size = 14)
)
)
)
## Warning: Specifying width/height in layout() is now deprecated.
## Please specify in ggplotly() or plot_ly()
foodsecurity_cat7 <- select(filter(foodsecurity3, Subcategory == 'Employment'),c(Year, Subcategory, Sub.subcategory, Food.insecure.percent, Very.low.food.security.percent))
# Convert Year to a factor for better ordering in the plot
foodsecurity_cat7$Year <- as.factor(foodsecurity_cat7$Year)
# Filter the data for the year 2018
filtered_data <- foodsecurity_cat7[foodsecurity_cat7$Year == 2018, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY EMPLOYMENT IN THE U.S. (2018)", # Use \n for a line break
x = "Employment",
y = "Percent of Households",
fill = "Employment"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)
foodsecurity_cat7$Year <- as.factor(foodsecurity_cat7$Year)
# Filter the data for the year 2020
filtered_data <- foodsecurity_cat7[foodsecurity_cat7$Year == 2020, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY EMPLOYMENT IN THE U.S. (2020)", # Use \n for a line break
x = "Employment",
y = "Percent of Households",
fill = "Employment"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)
# Convert Year to a factor for better ordering in the plot
foodsecurity_cat7$Year <- as.factor(foodsecurity_cat7$Year)
# Filter the data for the year 2021
filtered_data <- foodsecurity_cat7[foodsecurity_cat7$Year == 2022, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY EMPLOYMENT IN THE U.S. (2022)", # Use \n for a line break
x = "Employment",
y = "Percent of Households",
fill = "Employment"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)
foodsecurity_cat8 <- select(filter(foodsecurity3, Subcategory == 'Education'),c(Year, Subcategory, Sub.subcategory, Food.insecure.percent, Very.low.food.security.percent))
# Convert Year to a factor for better ordering in the plot
foodsecurity_cat8$Year <- as.factor(foodsecurity_cat8$Year)
# Filter the data for the year 2018
filtered_data <- foodsecurity_cat8[foodsecurity_cat8$Year == 2018, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY EDUCATION STATUS IN THE U.S. (2018)", # Use \n for a line break
x = "Education",
y = "Percent of Households",
fill = "Education"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)
# Convert Year to a factor for better ordering in the plot
foodsecurity_cat8$Year <- as.factor(foodsecurity_cat8$Year)
# Filter the data for the year 2020
filtered_data <- foodsecurity_cat8[foodsecurity_cat8$Year == 2020, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY EDUCATION STATUS IN THE U.S. (2020)", # Use \n for a line break
x = "Education",
y = "Percent of Households",
fill = "Education"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)
# Convert Year to a factor for better ordering in the plot
foodsecurity_cat8$Year <- as.factor(foodsecurity_cat8$Year)
# Filter the data for the year 2022
filtered_data <- foodsecurity_cat8[foodsecurity_cat8$Year == 2022, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY EDUCATION STATUS IN THE U.S. (2022)", # Use \n for a line break
x = "Education",
y = "Percent of Households",
fill = "Education"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)
foodsecurity_cat9 <- select(filter(foodsecurity3, Subcategory == 'Disability status'),c(Year, Subcategory, Sub.subcategory, Food.insecure.percent, Very.low.food.security.percent))
# Convert Year to a factor for better ordering in the plot
foodsecurity_cat9$Year <- as.factor(foodsecurity_cat9$Year)
# Filter the data for the year 2018
filtered_data <- foodsecurity_cat9[foodsecurity_cat9$Year == 2018, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY DISABILITY STATUS IN THE U.S. (2018)", # Use \n for a line break
x = "Disability Status",
y = "Percent of Households",
fill = "Disability Status"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)
# Convert Year to a factor for better ordering in the plot
foodsecurity_cat9$Year <- as.factor(foodsecurity_cat9$Year)
# Filter the data for the year 2020
filtered_data <- foodsecurity_cat9[foodsecurity_cat9$Year == 2020, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY DISABILITY STATUS IN THE U.S. (2020)", # Use \n for a line break
x = "Disability Status",
y = "Percent of Households",
fill = "Disability Status"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)
# Convert Year to a factor for better ordering in the plot
foodsecurity_cat9$Year <- as.factor(foodsecurity_cat9$Year)
# Filter the data for the year 2022
filtered_data <- foodsecurity_cat9[foodsecurity_cat9$Year == 2022, ]
# Reshape the data to long format
long_data <- tidyr::gather(filtered_data, key = "Variable", value = "Percentage", c("Food.insecure.percent", "Very.low.food.security.percent"))
# Create a stacked bar chart with switched x and y axes
ggplot(long_data, aes(x = Sub.subcategory, y = Percentage, fill = Variable)) +
geom_col(position = "stack") +
geom_text(aes(label = scales::percent(Percentage, scale = 1)), position = position_stack(vjust = 0.5), size = 3) +
labs(
title = "PREVALENCE OF FOOD INSECURITY AND VERY LOW FOOD SECURITY\nBY DISABILITY STATUS IN THE U.S. (2022)", # Use \n for a line break
x = "Disability Status",
y = "Percent of Households",
fill = "Disability Status"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1), # Adjust angle and position of x-axis labels
legend.position = "right", # Adjust legend position
panel.grid.major.y = element_blank(), # Remove y-axis gridlines
panel.grid.minor.y = element_blank() # Remove y-axis minor gridlines
)