-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimpress.R
47 lines (25 loc) · 872 Bytes
/
impress.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
library(viridis)
library(RColorBrewer)
library(ggplot2)
library(dplyr)
df.data <- tibble(x = runif(20000)
,y = rnorm(20000) * 0.2
)
ggplot(df.data, aes(x = x, y = y)) +
geom_point()+
ylim(c(-4,4))
gbleu <- ggplot(df.data, aes(x = x, y = y)) +
stat_density2d(aes(fill = ..density..), geom = 'tile', contour = F, show.legend = F)+
theme_void()
gbleu
display.brewer.all()
ggplot(df.data, aes(x = x, y = y)) +
stat_density2d(aes(fill = ..density.. ), geom = 'tile', contour = F) +
scale_fill_distiller(palette = 'YlOrBr')
ggplot(df.data, aes(x = x, y = y)) +
stat_density2d(aes(fill = ..density..), geom = 'tile', contour = F) +
scale_fill_distiller(palette = 'RdYlBu')+
ylim(c(-4,4))
ggplot(df.data, aes(x = x, y = y)) +
stat_density2d(aes(fill = ..density..), geom = 'tile', contour = F) +
scale_fill_viridis()