ggplot2: show missing value colour in legend
问题 Just wondering what is required so the colour for missing values is shown in the legend? Looking at example from the UseR! ggplot2 book, p94 p <- qplot(sleep_total, sleep_cycle, data=msleep, colour=vore) p + scale_colour_hue(na.value = "Black") p + scale_colour_hue("What does \nit eat?", na.value="Black", breaks=c("herbi", "carni", "omni", "insecti", NA), labels=c("plants", "meat", "both", "insects", "don't know")) the data point for vore=NA is shown in the plot but NA is not listed in the