lemon icon indicating copy to clipboard operation
lemon copied to clipboard

How to drop unused categories in x axis?

Open msgoussi opened this issue 7 months ago • 1 comments

library(ggplot2) library(lemon) df <- data.frame( v1 = c("A", "A", "A", "B", "B", "B"), v2 = c("S1", "S2", "S3", "S7", "S8", "S9"), nm = c(2, 3, 4, 5, 6, 7) )

ggplot(df, aes(x = v2, y = nm)) + geom_point(size = 3) + facet_rep_grid(v1~., scales = "free_x", repeat.tick.labels = T)

image

msgoussi avatar Nov 25 '23 09:11 msgoussi