njtierney/naniar

add white lines to clearly separate the missing values in `geom_missing_point`

Open

#30 创建于 2016年12月24日

在 GitHub 查看
 (5 评论) (2 反应) (0 负责人)R (557 star) (43 fork)batch import
enhancementhelp wantedvisualisation

描述

For example:

library(naniar)
library(ggplot2)
# method to draw new white band
y_white_band <- min(airquality$Solar.R, 
                    na.rm = TRUE) - 0.95 * min(airquality$Solar.R, 
                                               na.rm = TRUE)

x_white_band <- min(airquality$Ozone, 
                    na.rm = TRUE) - 0.95 * min(airquality$Solar.R, 
                                               na.rm = TRUE)

ggplot(data = airquality,
       aes(x = Ozone,
           y = Solar.R)) +
  geom_missing_point() + 
  # geom_hline(yintercept = -3,
  geom_hline(yintercept = y_white_band,
             size = 2,
             colour = "white") +
  # geom_vline(xintercept = -3,
  geom_vline(xintercept = x_white_band,
             size = 2,
             colour = "white")

As opposed to

ggplot(data = airquality,
       aes(x = Ozone,
           y = Solar.R)) +
  geom_missing_point() 

贡献者指南