Removing some label shortcuts in boxes in ggplot2

I am relatively new to ggplot, so I apologize if this is easy, but I did not find anything on the Internet.

I want to display 29 mailboxes (numbered 1.1 to 4.0) next to each other in ggplot2 (what can I do), but as soon as I tick the tick the appropriate size (what can I do), the labels overlap and I just want a few ( 1.5, 2, 2.5, etc.) in any case. How to remove only some label shortcuts? Also, anyway, can I include a checkmark in 1.0 so that my shortcut labels are nice, round numbers?

My data is a list that I “melted”, since each box has a different number of observations.

My current code is:

list = list(data11, data12, ... data39, data40) # Elipse denotes the rest of the sequence
df = melt(list)

ggplot(df, aes(factor(variable), value)) + 
    geom_boxplot(outlier.size=1.5, colour="black") + 
    xlab("Xlabel") +
    ylab("Ylabel") +
    theme_classic() + 
    theme(
        axis.text.x = element_text(size=12),
        axis.text.y = element_text(size=12),
        axis.title.x = element_text(size=14),
        axis.title.y = element_text(size=14, angle=90),
        axis.line = element_line(size=0.75)
    )
+4
1

. .

, . ( ! . ), . :

df.so1 <- runif(10); df.so2 <- runif(10); df.so3 <- runif(10)
list.so = list(df.so1, df.so2, df.so3)
df.so = melt(list.so)

ggplot(df.so, aes(factor(L1), value)) + 
  geom_boxplot(outlier.size=1.5, colour="black") + 
  xlab("Xlabel") + ylab("Ylabel") +
  theme_classic() + 
  theme(
    axis.text.x = element_text(size=12),
    axis.text.y = element_text(size=12),
    axis.title.x = element_text(size=14),
    axis.title.y = element_text(size=14, angle=90),
    axis.line = element_line(size=0.75)
  ) + 
  scale_x_discrete(breaks = c(1,3))

, , , .. . ggplot2 .

Upd.

: bump1, bump2.

+4

All Articles