0

Hi all I have used this code to produce the plot below, someone know How I can switch the subplot, for example sorting them according to title? (25nm....1000nm)?

Ribo_plot <- ggplot(My_table, aes(x= Ribocliques,  group=Status)) + 
  geom_bar(aes(y = ..prop..),fill="seagreen4",alpha =.6, stat="count") +
  geom_text(aes( label = scales::percent(..prop..),
                 y= ..prop.. ), stat= "count", vjust = -.3) +
  labs(y = "Percentage of ribosome in each conformation", fill="Riboclique") +
  facet_grid(~Status) +
  scale_y_continuous(labels = scales::percent)+theme_bw(base_size = 30)
Ribo_plot

enter image description here

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
NotMyName
  • 51
  • 7

1 Answers1

0

try setting the levels of the factor before you plot

My_table$Status <- factor(My_table$Status, levels = c("25nm", "30nm", "35nm", "40nm", "50nm", "75nm", "100nm", "150nm", "1000nm"))

maarvd
  • 1,254
  • 1
  • 4
  • 14