Skip to content

Commit 5fae8f4

Browse files
Fixed title for gcf_grid
1 parent 4dd54a8 commit 5fae8f4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

R/gcf_grid.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ gcf_grid <- function (x = seq(0, 1, length.out = nrow(z)),
142142
if (mainminmax | !is.null(main)) {
143143
# Unable to put colors in title
144144
# p <- p + gg_make_multicolor_title()
145-
p <- p + ggplot2::ggtitle(paste0("[min,max]=[",signif(min(z),3),",", signif(max(z),3),"]")) +
145+
gtitle <- pretitle
146+
if (mainminmax_minmax) {
147+
gtitle <- paste0(gtitle, "[min,max]=")
148+
}
149+
gtitle <- paste0(gtitle, "[",signif(min(z),3),",", signif(max(z),3),"]", posttitle)
150+
p <- p + ggplot2::ggtitle(gtitle) +
146151
ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))
147152
# Max/min annotations since colors don't work
148153
minind <- arrayInd(which.min(z), dim(z))

Rplots.pdf

-3.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)