---
title: "Supplemental Figure 10"
author: "Meredith Hanlon"
date: "2023-04-13"
output: html_document
---

```{r global_options, echo = FALSE}
knitr::opts_chunk$set(warning=FALSE, message=FALSE, echo=FALSE, error = TRUE)
```

```{r}
library(tidyverse)
library(rstatix)
library(ggpubr)
library(readxl)
library(stats)
library(viridis)
library(patchwork)
library(ggpmisc)
library(ggthemes)
library(ggrepel)
library(FactoMineR)
library(factoextra)
library(corrplot)
library(mclust)
library(broom)
library(RColorBrewer)
library(ggh4x)

stderror <- function(x) sd(x, na.rm = TRUE) / sqrt(length(na.omit(x)))

theme_mh <- function(){ 
    font <- "sans"   #assign font family up front
    theme(
      panel.grid.major = element_blank(),
      panel.grid.minor = element_blank(),
      panel.background = element_blank(),
      panel.border = element_rect(color = "black", fill = NA),
      axis.ticks = element_line(color = "black"),   
      axis.line = element_line(color = "black"),
      strip.background = element_blank(),
      legend.key = element_rect(fill = NA),
      text = element_text(family = font, size = 10, color = "black"),
      axis.text = element_text(family = font, size = 8, color = "black")
    )
}


```

# Supplemental Figure 10 

```{r}
xd <- read_excel("Hanlon_2023_data.xlsx", sheet = "SFigure_10")
xd$plant_age2 <- as.factor(xd$plant_age2)

p1 <- ggplot(xd) +
  geom_boxplot(aes(x = plant_age2, y = Net, fill = Genotype)) +
  theme_mh() +
  theme(legend.position = "none") +
  facet_wrap(.~Genotype, ncol = 2, scales = "free") +
  scale_fill_tableau(direction = -1) +
  xlab("Plant Age") +
  ylab("XRF Counts Sr")
p1

ggsave("SFigure_10.png", width = 7.5, height = 4)
```

