title: How does plt.show() know what to show?
body: <p>My question is not about matplotlib in detail, but a general programming and question, and i'm looking for an answer on the mechanisms making this possible in python or matplotlib core.</p>
  
  <p>Let's say I have a scatter plot using the code:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  plt.scatter(a,b)
  plt.show()
  </code></pre>
  
  <p>I'm wondering how is this statement handled? <br>
  How does python (or matplotlib?) know what to plot and where to get the data?<br>
  How are these statement handled by interpreter?<br></p>