Created
August 11, 2020 16:22
-
-
Save gkaramanis/9e5076cfd0c0a117e8151244389f98e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(tidyr) | |
library(viridis) | |
df <- data.frame(x = 1:10, y = 1:10) %>% expand(x, y) %>% mutate(n = as.integer(runif(min = 0, max = 26, n = 100))) | |
pal <- c(viridis(n = 23), "black", "purple", "pink") | |
ggplot(df, aes(x, y, fill = factor(n))) + | |
geom_tile() + | |
scale_fill_manual(values = pal, breaks = 0:25) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment