Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ Theme fixes:
arguments that rely on non-standard evaluation against `data` (e.g.,
`plt_add(..., subset = <>)`) resolve correctly instead of erroring with
"object not found". (#638 @grantmcdermott)
- `plt(..., ann = FALSE)` correctly turns off title annotations now, fixing a
regression that we missed from at least v0.6.0. Thanks to @bastistician for
the report. (#641 @zeileis)

## v0.6.1

Expand Down
9 changes: 6 additions & 3 deletions R/tinyplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1244,9 +1244,12 @@ tinyplot.default = function(
}
}

draw_title(main, sub, cap, xlab, ylab, legend, legend_args, opar,
xlab_line_offset = if (!is.null(dynmar_computed)) .whtsbp_x_raw else 0,
ylab_line_offset = if (!is.null(dynmar_computed)) .whtsbp_y_raw - max(0, .ymgp_shift) - .ylab_cex_shift else 0)
ann = as.logical(ann)
Comment thread
grantmcdermott marked this conversation as resolved.
if (ann) draw_title(
main, sub, cap, xlab, ylab, legend, legend_args, opar,
xlab_line_offset = if (!is.null(dynmar_computed)) .whtsbp_x_raw else 0,
ylab_line_offset = if (!is.null(dynmar_computed)) .whtsbp_y_raw - max(0, .ymgp_shift) - .ylab_cex_shift else 0
)
}


Expand Down
62 changes: 62 additions & 0 deletions inst/tinytest/_tinysnapshot/ann_FALSE.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions inst/tinytest/test-misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,9 @@ f = function() {
tinyplot(Sepal.Length ~ 1, data = iris, xlab = "My X", ylab = "My Y")
}
expect_snapshot_plot(f, label = "formula_y1_cust_lab")

# ann = FALSE turns off titles (#626)
f = function() {
plt(0, 0, ann = FALSE)
}
expect_snapshot_plot(f, label = "ann=FALSE")