title: Plotting x-axis in MatLab
body: <p>The following variables are used:</p>
  
  <ul>
  <li><code>SP</code>: a known 8x1 row Vector containing random numbers.</li>
  <li><code>YP</code>: a known 8x1 row Vector containing random numbers.</li>
  </ul>
  
  <p>I have eight data points. For every 8 data points on x-axis, I have the following labels:</p>
  
  <p>Asset1 - Asset2 -  Asset3  - Asset4 -  Asset5  - Asset6 -  Asset7  - Asset8</p>
  
  <p><strong>Problem: when I implement my code, I get an infinite number of the above labels.</strong> </p>
  
  <p>This is my output from MatLab:</p>
  
  <p><img src="https://i.stack.imgur.com/FenZQ.jpg" alt="my output"></p>
  
  <p>This is my code:</p>
  
  <pre><code>SP = rand(8,1)/100;
  YP = (rand(8,1)/100)*2;
  plot(YP,'DisplayName','YP');
  hold on;
  plot(SP,'DisplayName','SP');
  hold off;
  title('SP and YP monthly returns');
  xlabel('Monthly time series');
  MY = 'Siemens SAP Daimler Allianz DEU.Telekom Adidas BMW DEU.Bank';
  set(gca, 'xTickLabels', 'Asset1 Asset2 Asset3 Asset4 Asset5 Asset6 Asset7 Asset8');
  xticklabel_rotate('Asset1 Asset2 Asset3 Asset4 Asset5 Asset6 Asset7 Asset8');
  ylabel('Percentage of prices discounts');
  set(gca, 'yTickLabels', num2str(100.*get(gca,'yTick')','%g%%'));
  </code></pre>