Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. I have tried ylim but does not work in my case.
  2.  
  3. season_top_scorer <- match_full%>%
  4. group_by(season,batsman)%>%
  5. summarize(total_runs = sum(batsman_runs))%>%
  6. arrange(season,desc(total_runs))%>%
  7. filter(total_runs == max(total_runs))%>%
  8. arrange(desc(total_runs))%>%
  9. ggplot(aes(x = season,y = total_runs,fill = batsman))+
  10. geom_bar(stat ="identity")+
  11. ggtitle("Highest run scorer each season")+
  12. theme(axis.text.x = element_text(angle = 90, hjust = 1))+
  13. scale_x_discrete(name="Season",
  14. limits=c(2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019))+
  15. geom_text(aes(label= total_runs,vjust= 0 ))+
  16. scale_y_discrete(name="Total Runs", limits=c(0,250,500,750,1000,1250))
  17.  
  18. The only problem is with season 2016. The height of bar is too big that
  19. its cutting off the label.Any idea what might solve this problem in the
  20. above code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement