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)) {