Making line plot with discrete x-axis in ggplot2

后端 未结 1 1455
太阳男子
太阳男子 2021-01-28 01:38

I am building a ggplot2 figure with a facet grid. On my Y-axis are percentages, and my X-axis is the concentration (in numbers). Each facet has 3 groups (0, 24 and 48 hours)

相关标签:
1条回答
  • 2021-01-28 02:20

    On this page they make the following modification df2$dose<-as.factor(df2$dose). You can try to modify your x-axis as df2$Concentration<-as.factor(df2$Concentration)

    or like this:

    ggplot(data=MasterTable, aes(x=factor(Concentration), y=Percentage, group=Time)) + 
      geom_point() + 
      geom_line() + 
      facet_grid(Chemicals ~ Treatments) 
    
    0 讨论(0)
提交回复
热议问题