MATLAB: Histogram problem

histogramx-axis changing in histogram

I plotted a histogram. I now trying to chang the way the x- axis is read.
The Data is huge so it currently reads 0, 200, 400, 800, 1000 Meanwhile i would like it to show the other bin sizes. my bin width is 5, therefore
I would like it to show 0, 5, 10, 15, 20….. 1000
I tried this hist(data(1:29196,1),[0:5:1000]);figure(gcf);
Thanks for any help received

Best Answer

set(gca, 'XTick', 0:5:1000)
However, this seems likely to want to place the labels so closely together that they will become unreadable.
If your data is sufficiently large, there is a possibility that representing it all would require more space than you have available in your figure. There really isn't any effective way of dealing with that except for allowing more space for the axes, or providing a partially-visible uipanel with scroll bars (FEX contributions available) that shows the image at a higher resolution.