From 131870b4bceff60ae2245dba3bc1752b3f2103b7 Mon Sep 17 00:00:00 2001 From: rhijmans Date: Mon, 9 Dec 2024 12:26:22 -0800 Subject: [PATCH] fixes #1664 --- R/plot_legend.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/plot_legend.R b/R/plot_legend.R index 18069dc86..c15743a0b 100644 --- a/R/plot_legend.R +++ b/R/plot_legend.R @@ -400,7 +400,7 @@ retro_labels <- function(x, lat=TRUE) { graphics::rect(e$xmin, e$ymin, e$xmax, e$ymax, border=ticboxcol, xpd=NA) - if (!is.null(x$leg$title)) { + if (isTRUE("title" %in% names(x$leg))) { leg_i <- x$leg$leg_i if (is.null(leg_i)) leg_i = 1 if (leg_i <= length(x$leg$title)) {