Skip to content

Instantly share code, notes, and snippets.

@gtgrthrst
Created May 9, 2021 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtgrthrst/23a2c4ff5a5e9f47e450c5ec5857cab2 to your computer and use it in GitHub Desktop.
Save gtgrthrst/23a2c4ff5a5e9f47e450c5ec5857cab2 to your computer and use it in GitHub Desktop.
library(rayshader)
library(ggsci) # 修改配色
p1 <- ggplot(diamonds, aes(x, depth)) +
stat_density_2d(aes(fill = stat(nlevel)),
geom = "polygon",
n = 100,bins = 10,contour = TRUE) +
theme(axis.title=element_blank(),
axis.text=element_blank(),
axis.ticks=element_blank()
) + scale_fill_viridis_c()
p1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment