Different colors with gradient for subgroups on a treemap ggplot2 R
I have a treemap plot (shown below). The only change that I want to have is to change the color of subgroup (YEAR in the plot) to different colors, not all blue. Is this possible at all? Sample data frame PL <- c(rep("PL1", 4), repl("PL2", 4), rep("PL3", 4), rep("PL4", 4)) CNT <- sample(seq(1:50), 16) YEAR <- rep(c("2015", "2016", "2017", "2018"), 4) df <- data.frame(PL, YEAR, CNT) Plot PL <- c(rep("PL1", 4), repl("PL2", 4), rep("PL3", 4), rep("PL4", 4)) CNT <- sample(seq(1:50), 16) YEAR <- rep(c("2015", "2016", "2017", "2018"), 4) df <- data.frame(PL, YEAR, CNT) # plot library(ggplot2)