Skip to content

Commit

Permalink
handle cex.axis in legend keys
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Aug 17, 2023
1 parent aeefffd commit 6b2dd7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 6 additions & 4 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,10 @@ bb2merc = function(x, cls = "ggmap") { # return bbox in the appropriate "web mer
#' @param logz ignore
#' @param ... ignore
#' @param lab ignore
#' @param cex.axis see \link{par}
.image_scale = function(z, col, breaks = NULL, key.pos, add.axis = TRUE,
at = NULL, ..., axes = FALSE, key.length, logz = FALSE, lab = "") {
at = NULL, ..., axes = FALSE, key.length, logz = FALSE, lab = "",
cex.axis = 1) {
if (!is.null(breaks) && length(breaks) != (length(col) + 1))
stop("must have one more break than colour")
stopifnot(is.character(lab) || is.expression(lab))
Expand Down Expand Up @@ -861,14 +863,14 @@ bb2merc = function(x, cls = "ggmap") { # return bbox in the appropriate "web mer
TRUE

if (add.axis)
axis(key.pos, at = at, labels = labels)
axis(key.pos, at = at, labels = labels, cex.axis = cex.axis)
}

#' @name stars
#' @export
#' @param key.width ignore
.image_scale_factor = function(z, col, key.pos, add.axis = TRUE,
..., axes = FALSE, key.width, key.length) {
..., axes = FALSE, key.width, key.length, cex.axis = 1) {

n = length(z)
# TODO:
Expand Down Expand Up @@ -918,7 +920,7 @@ bb2merc = function(x, cls = "ggmap") { # return bbox in the appropriate "web mer

if (add.axis) {
opar = par(las = 1)
axis(key.pos, at = 1:n, labels = z)
axis(key.pos, at = 1:n, labels = z, cex.axis = cex.axis)
par(opar)
}
}
Expand Down
8 changes: 6 additions & 2 deletions man/stars.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6b2dd7f

Please sign in to comment.