title: How to set the size of a figure in Python matplotlib
body: <p>Could someone tell me, why the size of the figure generated by the code below is not as expected. </p>
  
  <p>How can I modify this code to generate a picture with 100*400 pixels?</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  fig  = plt.figure(figsize=(1,4),dpi=100,facecolor = 'red')
  plt.show(fig)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/I2JPw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I2JPw.png" alt="screenshot"></a></p>