R ggplot heatmap using geom_tile(): how to sort by year and show all years in y-axis?

前端 未结 1 1589
感情败类
感情败类 2021-02-03 10:49

After studying Hadley\'s book and searching here on SO I have created a heatmap consisting of a matrix of years and months, with the colour varying according the percentage chan

相关标签:
1条回答
  • 2021-02-03 11:31

    For the first two points, you can replace scale_y_continuous with scale_y_reverse to have the earliest years on top, and explicitly specify the breaks and labels.

    p_heat +  scale_y_reverse(breaks=1995:2011, labels=1995:2011, expand=c(0,0) )
    
    0 讨论(0)
提交回复
热议问题