Skip to content

Commit

Permalink
add panel border for ggmark and cross_mark
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Jan 9, 2025
1 parent d0274bf commit b68bb95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/cross-mark.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cross_mark <- function(mark, data = waiver(), reorder = NULL, obs_size = 1,
cross(CrossMark,
data = data, mark = mark, reorder = reorder, obs_size = obs_size,
plot = ggplot(), size = size,
schemes = default_schemes(),
schemes = default_schemes(th = theme_panel_border()),
active = active,
inherit_nobs = inherit_nobs,
inherit_panel = inherit_panel,
Expand Down
2 changes: 1 addition & 1 deletion R/ggmark.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ggmark <- function(mark, data = waiver(), mapping = aes(), ...,
# slot
plot = ggplot(mapping = mapping),
size = size,
schemes = default_schemes(data),
schemes = default_schemes(data, th = theme_panel_border()),
active = active
)
}
Expand Down
2 changes: 2 additions & 0 deletions R/ggplot-theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ theme_no_strip <- function() {
)
}

theme_panel_border <- function() theme(panel.border = element_rect(fill = NA))

#' @importFrom utils packageVersion
#' @importFrom rlang try_fetch
complete_theme <- function(theme) {
Expand Down

0 comments on commit b68bb95

Please sign in to comment.