Skip to content

Commit c192cab

Browse files
committed
making common legend for effect of k plot
1 parent ba84c17 commit c192cab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

classification2.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
```{r classification2-setup, echo = FALSE, message = FALSE, warning = FALSE}
44
library(gridExtra)
5+
library(cowplot)
56
67
knitr::opts_chunk$set(fig.align = "center")
78
```
@@ -893,8 +894,9 @@ for (i in 1:length(ks)) {
893894
labs(color = "Diagnosis") +
894895
ggtitle(paste("K = ", ks[[i]])) +
895896
scale_color_manual(labels = c("Malignant", "Benign"),
896-
values = c("orange2", "steelblue2"))
897-
}
897+
values = c("orange2", "steelblue2"))
898+
}
899+
898900
p_no_legend <- lapply(plots, function(x) x + theme(legend.position = "none"))
899901
legend <- get_legend(plots[[1]] + theme(legend.position = "bottom"))
900902
p_grid <- plot_grid(plotlist = p_no_legend, ncol = 2)

0 commit comments

Comments
 (0)