title: How to plot percentage on x-axis?
body: <p>I managed to read a large excel sheet in MATLAB, sorted the data and plotted the graph of the wanted data. The problem that I am experiencing is that I am trying to make the values of x-axis as a percentage. I have a variable of around 1000 integers which may increase as I add data. I have assigned a variable to check the length of variable so that I do not have to change it manually. The problem is that I need to assign the x-axis in terms of 10%, 20%... 100%. How can I do that without reducing data for the y-axis?</p>
  
  <p>The following is the code for the x-axis:</p>
  
  <pre><code>A = round(length(data),2,'significant');
  d = 0.1*A
  e = 0:d:A
  f = e/A*100
  set(gca,'xticklabel', f)
  </code></pre>
  
  <p>The x-axis is showing up till 90%. The length of <code>data</code> is 16990, therefor <code>A</code> results in 17000, <code>d</code> results to be 1700, value of variable <code>f</code> is from 0 to 100 but the plot is still showing to 90%.</p>
  
  <p>The image below shows the graph with the data, without adding limits for the ticks:</p>
  
  <p><a href="https://i.stack.imgur.com/iml7M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iml7M.png" alt="https://i.imgur.com/ccMDkzF.png"></a></p>
  
  <p>On the other hand, when I have changed 'ticklabels', it only reduced to the first points of the graph. Whilst when I have converted ticklabels to 'ticks', the graph is shown in full but the ticks are as shown below:</p>
  
  <p><a href="https://i.stack.imgur.com/mKtcl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mKtcl.png" alt="https://i.imgur.com/uZPU45S.png"></a></p>
  
  <p>What I am trying to do is convert the 18000 into 100%. </p>