MATLAB: Show numbers on axis

axishistogram

I have a histogram with the x-axis labeled from 0 to 20 in increments of 5 (0-5-10-15-20). I would like to display all of the numbers from 0 to 20 instead (0-1-2-3-4-5…20). Thanks in advance.

Best Answer

Try adding this command after you plot it:
xticks(0 : 20)