A Basic Plot
Show the code
x <- seq(1,10)
mydata <- data.frame(x)
library(ggplot2)
p1 <- ggplot(mydata,
aes(x = x,
fill = factor(x),
y = 1)) +
geom_col() +
scale_x_continuous(breaks=seq(1,10,1)) +
theme_minimal() +
theme(axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
axis.title.y = element_blank())
p1 # replay this plot
Palettes
Viridis
Show the code
p1 +
labs(title = "Viridis") +
scale_fill_viridis_d(name = "viridis")
Show the code
Cividis
Show the code
p1 +
labs(title = "Cividis") +
scale_fill_viridis_d(name = "Cividis",
option = "cividis")
Plasma
Show the code
p1 +
labs(title = "Plasma") +
scale_fill_viridis_d(name = "Plasma",
option = "plasma")
Magma
Show the code
p1 +
labs(title = "Magma") +
scale_fill_viridis_d(name = "Magma",
option = "magma")
Mako
Show the code
p1 +
labs(title = "Magma") +
scale_fill_viridis_d(name = "Mako",
option = "mako")
Rocket
Show the code
p1 +
labs(title = "Rocket") +
scale_fill_viridis_d(name = "Rocket",
option = "rocket")
Turbo
Show the code
p1 +
labs(title = "Turbo") +
scale_fill_viridis_d(name = "Turbo",
option = "turbo")