title: C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:8: RuntimeWarning: invalid value encountered in log
body: <p>I tried the code below, but got the warn message in the log:</p>
  <pre><code>C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py:8: RuntimeWarning: invalid value encountered
  </code></pre>
  <p>What is this? And how can I solve this problem?</p>
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  x = np.linspace(-np.e, np.e, 100)
  
  plt. plot(x, np.exp(x), '-')
  
  plt. plot(x, np.log(x), '-')
  
  plt.legend(('y=e^x', 'y=lnx'))
  plt. xlabel('x')
  plt. ylabel('y')
  
  a = plt.gca()
  a.spines['bottom'].set_position('zero')
  a.spines['left'].set_position('zero')
  
  a.spines['top'].set_color('None')
  a.spines['right'].set_color('None')
  </code></pre>
  <p><img src="https://i.stack.imgur.com/ODLhD.png" alt="" /></p>