【问题标题】:How can I order the subplot inside a plot in ggplot? [duplicate]如何在 ggplot 的图中订购子图? [复制]
【发布时间】:2021-07-17 13:03:09
【问题描述】:

大家好,我已经使用此代码生成了下面的图,有人知道我如何切换子图,例如根据标题对它们进行排序? (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

【问题讨论】:

    标签: r ggplot2


    【解决方案1】:

    在绘制之前尝试设置因子的水平

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-05
      • 2021-12-31
      相关资源
      最近更新 更多