0

I am struggling to add colours to my charts but I keep getting the error:

continuous value supplied to discrete scale

This is the code I am using:

ggplot(by_team_mean_score1) +
  geom_col(mapping = aes(x = reorder(team1, mean_score1), y = mean_score1))+
  theme(axis.text.x = element_text(angle = 60, hjust = 1)) +
  ggtitle("Mean No. of Home Goals") +
  xlab("Team") +
  ylab("Mean No. Home Goals")
divibisan
  • 11,659
  • 11
  • 40
  • 58
  • please add sample of your data – Paolo Lorenzini Mar 05 '19 at 14:59
  • `geom_col(aes(x = reorder(team1, mean_score1), y = mean_score1, group = team, colour = team))` assuming that "team" is a variable in your dataset – MDEWITT Mar 05 '19 at 15:01
  • Possible duplicate of [Add color to boxplot - "Continuous value supplied to discrete scale" error](https://stackoverflow.com/questions/10805643/add-color-to-boxplot-continuous-value-supplied-to-discrete-scale-error) – divibisan Mar 05 '19 at 16:11

0 Answers0