I want to plot the result of a test in a barplot sorted by groups. I want to insert all possible results (0 to 50 points), even if nobody reached that result.
I got this but I want spaces in real length. For example, between 30 and 41.
team=c("m","w","m","w","w","m","m","w","m","w","m","w","m","m","m","m","m","w","w","m")
pts=c(12,27,6,26,29,16,23,30,20,17,41,14,8,9,5,7,28,42,6,27)`
df <- data.frame(team,pts)
df
barplot(table(df$team, df$pts), las=1, beside=TRUE,border="white",
axis.lty = 1, xlim=c(0,50), ylim= c(0,2),axes=FALSE,
col=c("lightblue","pink")
)
Now I wonder, how I can customize the x-axis so that every possible result is displayed?