I have a plot with a discrete colorscheme (109 different levels) and a colorstep legend. The legend then shows all ticks for each color. How can I only show a few of the labels and ticks in the legend rather than all? Plot 1 shows the legend when the labels are still there
Plot 2 shows the legend without the labels. I want to show only certain labels in the legend, to make it actually understandable (10 different values rather than 100). How do I do that? My code is below, I am clearly doing something wrong, I just do not know what it is.
tt <- ggplot() +
# first layer: all countries, no fill, no white outlines
geom_polygon(data = maps2,
aes(x = long, y = lat, group = group), fill="grey", show.legend = F, size = 0.1) +
# second layer: only countries with a fill
geom_polygon(data = test,
aes(x = long, y = lat, group = group, fill = as.factor(tally)), show.legend = T)+
scale_fill_viridis_d(option="D", na.value = NA)+
facet_grid(~IO)+
theme( strip.text.x = element_blank())
tt + guides(fill=guide_colorsteps(label = F, title=element_blank())