Search code examples
matlabplotcurve

How to scale `X` axis and include the data -- Matlab


I want to plot on X axis the points [8,16,32,64,128,512] and on Y axis the corresponding values to these points. I have done the following, but eventhough I have specified the X axis and selected the colum values for it, I am not getting the numbers [8,16,32,64,128,512] displayed on X axis.


Solution

  • Use xticks([8 16 32 64 128 256 512]) right after plot (or you may have to get handle of the axe) to set display ticks in X axis