Skip to content

Commit

Permalink
tbnisgFLUC fig has algae, none remove from dominant in b panel, add x…
Browse files Browse the repository at this point in the history
… axis text to all panels
  • Loading branch information
fawda123 committed Aug 28, 2024
1 parent ed03385 commit 6b8f05a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
34 changes: 23 additions & 11 deletions R/figs.R
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,24 @@ st1 <- ggplot(BVcover, aes(x = reorder(SAVcover,Count), y = mean_value)) +
x = "FLUCCSCODE",
y = "Percent SAV cover",
title = '(a) Percent SAV cover by FLUCCSCODE',
) + scale_y_continuous(limits = c(0,100),breaks=breaks_extended(4)) +
theme_minimal() + theme(axis.title.x = element_blank(),
axis.text.x = element_blank())
) +
scale_y_continuous(limits = c(0,100),breaks=breaks_extended(4)) +
theme_minimal() +
theme(
axis.title.x = element_blank(),
axis.text.x = element_text(colour = 'black', angle = 60, size = 9, hjust = 1)
)

Dominantper <- FLUC %>%
group_by(Dominant,TBEP_seg,SAVcover) %>%
summarize(Count=n())%>%
mutate(perc = (Count / 1475 * 100),
segment = factor(TBEP_seg, levels = c('OTB', 'HB', 'MTB', 'LTB')))
summarize(
Count=n(),
.by = c(Dominant, TBEP_seg, SAVcover)
) %>%
mutate(
perc = (Count / 1475 * 100),
segment = factor(TBEP_seg, levels = c('OTB', 'HB', 'MTB', 'LTB'))
) %>%
filter(!Dominant %in% c('Algae', 'None'))

st2 <- ggplot(Dominantper, aes(x = reorder(SAVcover,Count), y = perc, fill = Dominant)) +
geom_bar (stat="identity") + # Bar plot for percent
Expand All @@ -289,9 +298,13 @@ st2 <- ggplot(Dominantper, aes(x = reorder(SAVcover,Count), y = perc, fill = Dom
x = "FLUCCSCODE",
y = "Percent of samples",
title = '(b) Dominant SAV by FLUCCSCODE',
) + scale_y_continuous(limits = c(0,40),breaks=breaks_extended(4)) +
theme_minimal()+theme(axis.title.x = element_blank(),
axis.text.x = element_blank())
) +
scale_y_continuous(limits = c(0,30), breaks=breaks_extended(4)) +
theme_minimal() +
theme(
axis.title.x = element_blank(),
axis.text.x = element_text(colour = 'black', angle = 60, size = 9, hjust = 1)
)

TBNI <- div %>%
mutate(SAVcover = case_when(
Expand All @@ -312,7 +325,6 @@ TBNI_sav <- TBNI_sav%>%
)

st3 <- ggplot(TBNI_sav, aes(x = reorder(SAVcover,Count), y = mean_value)) +
geom_line() +
geom_point() +
geom_errorbar(
aes(ymin = mean_value - std_error, ymax = mean_value + std_error),
Expand Down
Binary file modified figs/tbnisgFLUC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions fim-seagrass.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

UseNativePipeOperator: No

0 comments on commit 6b8f05a

Please sign in to comment.