title: Understanding semilogy function
body: <p>I'm trying to understand <code>semilogy</code> function which is normally used for plotting data in MATLAB.</p>
  
  <p>As the definition says in MATLAB help section:</p>
  
  <blockquote>
    <p><code>semilogy(Y)</code> creates a plot using a base 10 logarithmic scale for the <code>y</code>-axis and a linear scale for the <code>x</code>-axis. It plots the columns of <code>Y</code> versus their index if <code>Y</code> contains real numbers.</p>
  </blockquote>
  
  <p>The below code should produce same plot:</p>
  
  <pre><code>y1 = 1:100;
  figure
  semilogy(y1, 'linewidth', 2);
  
  x2 = 1:100;
  y2 = log10(x2);
  figure
  plot(x2, y2, 'linewidth', 2);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/KdDft.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KdDft.png" alt="enter image description here"></a></p>
  
  <p>But as we can see, the y-axis limits are different between the plots. Can anybody clear my doubt?</p>