Skip to content

Commit

Permalink
fixed source data and faceted plot to include depth layers
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaracappa1 committed Jan 9, 2025
1 parent 032acb8 commit e93efdc
Show file tree
Hide file tree
Showing 4 changed files with 36,046 additions and 36,045 deletions.
5 changes: 3 additions & 2 deletions R/plot_thermal_habitiat_area.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ plot_thermal_habitat_area <- function(shadedRegion = NULL,
# optional code to wrangle ecodata object prior to plotting
# e.g., calculate mean, max or other needed values to join below

fix <- ecodata::thermal_habitat_area_annual |>
fix <- ecodata::thermal_habitat_area |>
dplyr::filter(EPU == filterEPUs)

limits <- fix |>
Expand All @@ -54,8 +54,9 @@ plot_thermal_habitat_area <- function(shadedRegion = NULL,
# ggplot2::geom_line(data=fix, ggplot2::aes(x = temp.threshold, ymin = areaMinProportion, ymax = areaMaxProportion))+
ggplot2::geom_line(data=fix,ggplot2::aes(x = temp.threshold, y= Value,group = Time,color = Time),alpha = 0.7,linewidth =1.2)+
ggplot2::scale_color_gradient(name = "Year",low = 'grey70',high ='blue2')+
ggplot2::geom_line(data=dplyr::filter(fix.this.year,Time == max(Time)),ggplot2::aes(x = temp.threshold, y = Value, linetype = as.factor(ReportYear)), color = 'black',alpha = 0.7,size =2)+
ggplot2::geom_line(data=dplyr::filter(fix.this.year,Time == max(Time)),ggplot2::aes(x = temp.threshold, y = Value, linetype = as.factor(ReportYear)), color = 'black',alpha = 0.7,linewidth =2)+
ggplot2::scale_linetype_manual(name = 'Report Year',values = 1)+
ggplot2::facet_wrap(~Depth)+
ggplot2::theme_bw()+
ggplot2::xlab('Temperature Threshold (\u00B0C)')+
ggplot2::ylab('Proportion of EPU Area above threshold') +
Expand Down
2 changes: 1 addition & 1 deletion data-raw/get_thermal_habitat_area.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ get_thermal_habitat_area <- function(save_clean = F){
show_col_types = F) |>
dplyr::relocate(Time,EPU,Depth,Var,Value,Source)

thermal_habitat_area$Depth <- factor(thermal_habitat_area$Depth, levels = c('0-25m','25-100m','100-3000m','AllDepths'))
thermal_habitat_area$Depth <- factor(thermal_habitat_area$Depth, levels = c('0-25m','25-100m','100-300m','AllDepths'))


if (save_clean){
Expand Down
Loading

0 comments on commit e93efdc

Please sign in to comment.