Skip to content

Commit

Permalink
comment out scale for ggplot in z_plot_fun in zone_summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Carvalho committed Apr 23, 2024
1 parent 1164b78 commit 9639a1b
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions R/zone_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -345,32 +345,32 @@ zone_summary <- function(dat,
ggplot2::coord_sf(xlim = c(bbox[1], bbox[3]), ylim = c(bbox[2], bbox[4]),
expand = TRUE)

binned <- (count | (!is.null(scale_args$brks) & !is.null(scale_args$bc)))

# choose between stepn and binned scale
if (binned) {
# # this gives the exact color from bin_colors
out <- out +
ggplot2::binned_scale(aesthetics = "fill",
scale_name = "stepsn",
palette = function(x) bin_colors,
breaks = brks,
show.limits = TRUE,
guide = "colorsteps",
name = legend_name,
labels = scales::comma)

} else {
# this will "ramp" (scale) the colors in bin_colors
out <- out +
ggplot2::scale_fill_stepsn(breaks = brks,
colors = bin_colors,
labels = scales::comma,
show.limits = TRUE,
values = scales::rescale(brks),
name = legend_name,
na.value = "white")
}
# binned <- (count | (!is.null(scale_args$brks) & !is.null(scale_args$bc)))
#
# # choose between stepn and binned scale
# if (binned) {
# # # this gives the exact color from bin_colors
# out <- out +
# ggplot2::binned_scale(aesthetics = "fill",
# scale_name = "stepsn",
# palette = function(x) bin_colors,
# breaks = brks,
# show.limits = TRUE,
# guide = "colorsteps",
# name = legend_name,
# labels = scales::comma)
#
# } else {
# # this will "ramp" (scale) the colors in bin_colors
# out <- out +
# ggplot2::scale_fill_stepsn(breaks = brks,
# colors = bin_colors,
# labels = scales::comma,
# show.limits = TRUE,
# values = scales::rescale(brks),
# name = legend_name,
# na.value = "white")
# }

out <-
out + fishset_theme() +
Expand Down

0 comments on commit 9639a1b

Please sign in to comment.