Closed mctrace closed 12 months ago
Hi there!
This looks like you are using gg_miss_fct
- this function returns a ggplot and ggplot chooses the legend breaks automatically. I often forget exactly how to do this, so a google search of "change range of legend ggplot" helped me get here.
You can change the legend breaks by overwriting the ggplot scale like so:
library(naniar)
# legend doens't go up to 100, stops around 60
gg_miss_fct(
x = airquality,
fct = Month
)
library(ggplot2)
# force legend to go up to 100
gg_miss_fct(
x = airquality,
fct = Month
) +
viridis::scale_fill_viridis(
name = "% Miss",
limits=c(0, 100),
breaks=seq(0,100,by=25)
)
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
Created on 2023-12-01 with reprex v2.0.2
Let me know if that works for you!
I can't seem to find any info on how to define the range of % Miss. Most of the other figures I created have 0-100%, some have a range of 0-30%. The example below seems to have the 100% cut off.