Skip to content

Commit

Permalink
fix: default plot color
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindhebbali committed Jan 30, 2024
1 parent 754b34a commit 4dacbc9
Show file tree
Hide file tree
Showing 21 changed files with 161 additions and 161 deletions.
14 changes: 7 additions & 7 deletions R/rfm-ggplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ rfm_gg_heatmap <- function(mapdata, plot_title, xaxis_label, yaxis_label,
colours = brewer.pal(n = brewer_n, name = brewer_name),
name = legend_title)


return(p)

}

#' @importFrom ggplot2 geom_bar ylim coord_flip geom_text position_dodge
Expand Down Expand Up @@ -165,8 +165,8 @@ rfm_gg_revenue_dist <- function(data, colors, legend_labels, flip,

p <-
ggplot(data, aes(fill = category, y = share, x = segment)) +
geom_bar(position = "dodge", stat = "identity")
geom_bar(position = "dodge", stat = "identity")


p <-
p +
Expand All @@ -179,7 +179,7 @@ rfm_gg_revenue_dist <- function(data, colors, legend_labels, flip,
theme(legend.title = element_blank(),
legend.position = "bottom",
panel.background = element_rect(fill = NA),
axis.ticks = element_line(color = NA))
axis.ticks = element_line(color = NA))


if (flip) {
Expand Down Expand Up @@ -248,7 +248,7 @@ rfm_gg_median <- function(data, bar_color, sort, ascending, flip, plot_title,
}

if (is.null(bar_color)) {
bar_color <- "blue"
bar_color <- "#0f1a34"
}

if (sort) {
Expand Down Expand Up @@ -336,7 +336,7 @@ rfm_gg_segment <- function(table, metric, print_plot) {
theme(legend.position = "none")

return(plot)

}

rfm_gg_segment_scatter <- function(segments, x_data, y_data, plot_title,
Expand Down
8 changes: 4 additions & 4 deletions R/rfm-plotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,18 @@ rfm_plotly_median <- function(data, bar_color = NULL, sort = FALSE,

if (is.null(yaxis_label)) {
yaxis_label <- ycol
}
}

if (is.null(plot_title)) {
plot_title <- paste(yaxis_label, " by Segment")
}
}

if (is.null(xaxis_label)) {
xaxis_label <- "Segment"
}
}

if (is.null(bar_color)) {
bar_color <- "blue"
bar_color <- "#0f1a34"
}

if (flip) {
Expand Down
16 changes: 8 additions & 8 deletions tests/testthat/_snaps/rfm-plots/rfm-median-frequency-flip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions tests/testthat/_snaps/rfm-plots/rfm-median-frequency-sort.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4dacbc9

Please sign in to comment.