title: Wondering why matplotlib pyplot won't adjust margins
body: <p>I want to add margins to the plot so that rather than having the <code>0.0</code> be at the edge corner, the <code>0.0</code> is slightly away from the corner. I'm looking at <a href="https://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.margins" rel="noreferrer">the docs</a> and it would seem that adding this line <code>plt.margins(x_margin, y_margin)</code> should add padding. My output below however still is the same regardless of that function call and still is missing margin padding.</p>
  
  <p><a href="https://i.stack.imgur.com/55sWZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/55sWZ.png" alt="enter image description here"></a></p>
  
  <p>Example code to produce:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  plt.plot([0, 0.1, 0.3, 0.5, 0.7, 0.9, 1], [0.16, 0.17, 0.18, 0.19, 0.2, 0.21, 0.22], 'ro')
  plt.axis([0, 1, 0.15, 0.3])
  # Create a 10% (0.1) and 10% (0.1) padding in the
  # x and y directions respectively.
  plt.margins(0.1, 0.1)
  plt.show()
  </code></pre>