Skip to content

Commit

Permalink
Tweaked so legend and plot color orders match
Browse files Browse the repository at this point in the history
  • Loading branch information
njlyon0 committed Aug 24, 2023
1 parent aae9e1e commit f99f1aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/site_timeline.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ site_timeline <- function(sites = NULL, habitats = NULL, colors = NULL){

# Use the default colors
times_v2 <- times_v1 +
ggplot2::scale_fill_manual(values = habitat_colors) +
ggplot2::scale_color_manual(values = habitat_colors) }
ggplot2::scale_fill_manual(values = habitat_colors, breaks = rev(names(habitat_colors))) +
ggplot2::scale_color_manual(values = habitat_colors, breaks = rev(names(habitat_colors))) }

# If no palette is provided, just use the default colors (no error message)
if(is.null(colors) == TRUE){

times_v2 <- times_v1 +
ggplot2::scale_fill_manual(values = habitat_colors) +
ggplot2::scale_color_manual(values = habitat_colors) }
ggplot2::scale_fill_manual(values = habitat_colors, breaks = rev(names(habitat_colors))) +
ggplot2::scale_color_manual(values = habitat_colors, breaks = rev(names(habitat_colors))) }

# Return that object
return(times_v2) }

0 comments on commit f99f1aa

Please sign in to comment.