ggplot: order of factors with duplicate levels

后端 未结 1 1425

ggplot changes the order of an axis variable, which I do not want. I know I can change the variable to a factor and specify the levels to get around this, but what if the levels

相关标签:
1条回答
  • Just so this has an answer, this works just fine:

    df$season2 <- factor(df$season, levels=unique(df$season))
    ggplot(df, aes(x=season2, y=temp, colour=type, group=type)) + 
       geom_point() + 
       geom_line()
    
    0 讨论(0)
提交回复
热议问题