Skip to content

Commit

Permalink
added indicator thermal_habitat_area_annual and associated plot
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaracappa1 committed Jan 6, 2025
1 parent 513db43 commit 37f16c2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 14 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export(plot_stom_fullness)
export(plot_storminess)
export(plot_survey_shannon)
export(plot_thermal_habitat_area)
export(plot_thermal_habitat_area_annual)
export(plot_thermal_habitat_gridded)
export(plot_trans_dates)
export(plot_wcr)
Expand Down
9 changes: 7 additions & 2 deletions R/plot_thermal_habitiat_area_annual.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ plot_thermal_habitat_area_annual <- function(shadedRegion = NULL,
fix <- fix |>
dplyr::left_join(limits,by=c("Var","Time"))

fix.this.year = fix |>
dplyr::filter(Time == max(Time)) |>
dplyr::mutate(ReportYear = max(Time))

p <- ggplot2::ggplot()+
# 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,size =1)+
ggplot2::geom_line(data=fix,ggplot2::aes(x = temp.threshold, y= Value,group = Time,color = Time),alpha = 0.7,size =1.2)+
ggplot2::scale_color_gradient(name = "Year",low = 'grey70',high ='blue2')+
ggplot2::geom_line(data=dplyr::filter(fix,Time == max(Time)),ggplot2::aes(x = temp.threshold, y= Value),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,size =2)+
ggplot2::scale_linetype_manual(name = 'Report Year',values = 1)+
ggplot2::theme_bw()+
ggplot2::xlab('Temperature Threshold (\u00B0C)')+
ggplot2::ylab('Proportion of EPU Area above threshold') +
Expand Down
13 changes: 1 addition & 12 deletions man/plot_thermal_habitat_area.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions man/plot_thermal_habitat_area_annual.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37f16c2

Please sign in to comment.