我正在尝试使用ggplot生成热图,以显示随时间变化的值。我的大部分情节都被大黑条覆盖。如何删除这些栏以仅看到红色和绿色?
set.seed(1)
df <- data.frame(datetime = seq(dmy_hm("12/04/2020 12:00"), dmy_hm("12/04/2020 13:00"), "5 min"),
bund = as.factor("P1"),
inflow = (rnorm(13)))
plot <- ggplot(df, aes(x = datetime, y = bund, colour = inflow)) +
geom_tile(height = 0.9) +
scale_colour_gradient2(low = "red", high = "green", midpoint = 0)
plot