Вы имеете в виду, как это?
Вариант 1 (ручной)
ggplot(aes(x = c2.intervals, fill = c1), data = c) +
geom_histogram(stat = "count") +
scale_x_discrete(labels = c("", "(30,50]", "", "(70,120))", ""))
Вариант 2 (показывать каждый n-й)
xlabels <- levels(c$c2.intervals)
xlabels[seq(1, length(xlabels), 2)] <- ""
ggplot(aes(x = c2.intervals, fill = c1), data = c) +
geom_histogram(stat = "count") +
scale_x_discrete(labels = xlabels)
Данные
library(dplyr)
library(ggplot2)
c1 <- c("p2","p3","p1","p2","p1","p3","p4","p4","p4","p1","p1","p2","p2","p3","p4","p2","p1","p4","p3","p3")
c2 <- c(41,146,79,107,131,127,32,88,119,148,32,65,36,23,44,76,100,98,121,104)
df <- data.frame(c1 = c1, c2 = c2)
c <- mutate(df, c2.intervals = cut(c2, breaks = c(0, 30, 50, 70, 120, 150)))