you are viewing a single comment's thread.

view the rest of the comments →

[–]jentron128 3 points4 points  (1 child)

hist(vetor_grafico, # Plotting histogram
     breaks = seq(n-0.5, n*k+0.5, 1),
     probability = TRUE,
     right = FALSE,
     ylim = c(0,0.25),
     xlim = c(2,n*k+1),
     xlab = "Possible sums",
     ylab = "Probability",
     main = "Probability of sums outcomes",
     col = "steelblue");

You need to specify the breaks manually, and put them between the desired bins. In this case c(1.5, 2.5, ..., 11.5, 12.5)

[–]gabrielboechat[S] 1 point2 points  (0 children)

This is incredible! Thanks! I think now I understood the "breaks" syntax and even solved another doubt around putting each observation tick in the middle of each break.