an class="n">y_array</span> <span class="o">&lt;=</span> <span class="n">y_max</span><span class="p">)]</span>
        
    <span class="c1"># convert to log scale</span>
    <span class="k">if</span> <span class="n">xscale</span> <span class="o">==</span> <span class="s1">&#39;log10&#39;</span><span class="p">:</span>
        <span class="n">x_array</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="n">x_array</s