title: Replace yaxis values with text
body: <p>I have a list of labels:</p>
  
  <pre><code>lnames = {'nameA','nameB','nameC'}
  </code></pre>
  
  <p>and a vector with indices:</p>
  
  <pre><code>Y = [1; 1; 2; 3; 2];
  </code></pre>
  
  <p><code>index(1)</code> refers to <code>nameA</code>, <code>index(2)</code> to <code>nameB</code> etc.</p>
  
  <p>I want to show when a certain name is selected:</p>
  
  <pre><code>plot(Y, 'd')
  </code></pre>
  
  <p>This gives me a plot (on bigger scale as follows):</p>
  
  <p><a href="https://i.stack.imgur.com/Wuubd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wuubd.png" alt="enter image description here"></a></p>
  
  <p>However, I want to replace the numerical values on the yaxis with the labels. Thus <code>1</code> becomes <code>nameA</code>, <code>2</code> becomes <code>nameB</code>, etc. It would look as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/WxND6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WxND6.png" alt="enter image description here"></a></p>
  
  <p>How can this be achieved?</p>