Skip to content

Commit

Permalink
Fix #295
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Aug 14, 2023
1 parent 0da0f22 commit 643f73b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export(set_dim)
export(wrap_elements)
export(wrap_ggplot_grob)
export(wrap_plots)
import(rlang)
importFrom(ggplot2,aes)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,element_grob)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* Patchwork objects now behaves more correctly like an unnamed list of ggplots.
This makes `View()` work on them (#317), and allow one to use `length()` to
determine the number of patches in a patchwork (#293)
* Expressions and calls can now be used as plot annotations in the same way as
they can be used for titles in ggplot2 (#295)

# patchwork 1.1.2

Expand Down
2 changes: 0 additions & 2 deletions R/aaa.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ GUIDE_LEFT <- 3
GUIDE_TOP <- 5
GUIDE_BOTTOM <- 15

`%||%` <- function(x, y) if (is.null(x)) y else x

patchwork_namespace_link <- function() NULL
7 changes: 6 additions & 1 deletion R/patchwork-package.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@
#' geom_boxplot(aes(gear, disp, group = gear))
#'
#' @keywords internal
'_PACKAGE'
"_PACKAGE"

## usethis namespace: start
#' @import rlang
## usethis namespace: end
NULL
2 changes: 1 addition & 1 deletion R/plot_annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ recurse_tags <- function(x, levels, prefix, suffix, sep, offset = 1) {
#' @importFrom grid unit
#' @importFrom utils tail
annotate_table <- function(table, annotation) {
p <- ggplot() + annotation$theme + do.call(labs, annotation[c('title', 'subtitle', 'caption')])
p <- ggplot() + annotation$theme + exec(labs, !!!annotation[c('title', 'subtitle', 'caption')])
p <- ggplotGrob(p)
max_z <- max(table$layout$z)
fix_respect <- is.matrix(table$respect)
Expand Down

0 comments on commit 643f73b

Please sign in to comment.