defining max and min yaxis values after using ax.set_yscale('log') in matplotlib python
<p>I generated the following chart:</p>

<p><a href="http://i.stack.imgur.com/R8wui.png" rel="nofollow"><img src="http://i.stack.imgur.com/R8wui.png" alt="Regular Chart"></a></p>

<p>Then wanted to adjust the vertical axis of the first subplot to show in logscale, 
so did <code>ax.set_yscale('log')</code>.</p>

<p>This produces the following chart:
<a href="http://i.stack.imgur.com/vuF3C.png" rel="nofollow"><img src="http://i.stack.imgur.com/vuF3C.png" alt="yaxis in logscale"></a></p>

<p>The question is how do I set max and min levels to show in this new logarithmic yscale? </p>

<p>The same as you do on any other scale, use <a href="http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.set_ylim" rel="nofollow"><code>ax.set_ylim()</code></a></p>

<p>If you want to set it to the range 8,20 as you have above, then pass those two limits to <code>set_ylim</code>:</p>

<pre><code>ax.set_ylim(8, 20)
</code></pre>

python matplotlib