Skip to content

Commit d26988a

Browse files
committed
Update example plot
1 parent 4455282 commit d26988a

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

data-raw/Example-plots.R

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ ggsave(reference.distributions.horizontal,
7575
#### Model performance figure for README.md ####
7676
load("./data/ikeogu.2017.rda")
7777
mypalette <- rev(lacroix_palettes$Lemon[1,])
78+
# mypalette <- my.palette.dists
79+
7880

7981
# C16M66.DMC <- ikeogu.2017 %>% filter(study.name == "C16M66") %>% rename(reference = DMC.oven) %>%
8082
# rename(unique.id = sample.id) %>%
@@ -161,6 +163,9 @@ write.csv(test.C16M.TCC, "./data-raw/C16M_TCC_nonsummary.csv", row.names = F)
161163
# hjust = 0.7))
162164
# ggsave(testplot.TCC, filename = "./man/figures/testplot_TCC.png", width = 7, height = 4, units = "in", bg = "transparent")
163165

166+
test.C16M.DMC <- read.csv("./data-raw/C16M_DMC_nonsummary.csv")
167+
test.C16M.TCC <- read.csv("./data-raw/C16M_TCC_nonsummary.csv")
168+
164169
test.C16M.DMC$Pheno <- "DMC"
165170
test.C16M.TCC$Pheno <- "TCC"
166171
testplot.joined <- rbind(test.C16M.DMC, test.C16M.TCC) %>%
@@ -184,19 +189,24 @@ testplot.all.R2 <- testplot.joined %>%
184189
"DMC" = "Root dry matter content",
185190
"TCC" = "Total carotenoid content")) %>%
186191
group_by(Pretreatment, Pheno) %>%
187-
ggplot(aes(y=R2p, x = Pretreatment, fill = Pheno))+
192+
ggplot(aes(y=R2p, x = Pretreatment, fill = Pheno)) +
193+
geom_hline(yintercept = 0.836, color = mypalette[2], linetype='dashed') +
194+
geom_hline(yintercept = 0.859, color = mypalette[6],linetype='dashed') +
188195
geom_boxplot(position = "dodge") +
189196
labs(y = expression("R"["p"]^2),
190197
x = "Pretreatment*") +
191198
#title = "waves prediction model performance",
192199
#subtitle = "PLSR with C16M datasets from Ikeogu et al. (2017)",
193-
#) +
200+
#)
201+
geom_vline(xintercept = seq(1, length(testplot.joined[,1]),1) + .5, color = "#E0E0E0") +
194202
scale_fill_manual(values=mypalette[c(2,6)], name = "Phenotype") +
195-
theme_minimal() + theme(axis.text.x = element_text(angle = 45,
196-
size = 8,
197-
hjust = 0.7),
198-
legend.position="bottom")
199-
ggsave(testplot.all.R2, filename = "./man/figures/testplot_all_R2.png", width = 7, height = 6, units = "in", bg = "transparent")
203+
theme_bw() +
204+
theme(axis.text.x = element_text(angle = 45, size = 8, hjust = 1),
205+
legend.position="bottom",
206+
panel.grid.major.x = element_blank())
207+
testplot.all.R2
208+
209+
ggsave(testplot.all.R2, filename = "./man/figures/testplot_all_R2_hlines.png", width = 7, height = 6, units = "in", bg = "transparent")
200210

201211
# summary table
202212
test.C16M.TCC.summary$Phenotype <- "TCC"
169 KB
Loading

0 commit comments

Comments
 (0)