njtierney/naniar

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

開放

#30 建立於 2016年12月24日

 (5 則留言) (2 個反應) (0 位負責人)R (56 個分叉)batch import
enhancementhelp wantedvisualisation

倉庫指標

星標
 (674 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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() 

貢獻者指南