title: Understanding matplotlib: plt, figure, ax(arr)?
body: <p>I'm not really new to <code>matplotlib</code> and I'm deeply ashamed to admit I have always used it as a tool for getting a solution as quick and easy as possible. So I know how to get basic plots, subplots and stuff and have quite a few code which gets reused from time to time...but I have no "deep(er) knowledge" of <code>matplotlib</code>.</p>
  
  <p>Recently I thought I should change this and work myself through some tutorials. However, I am still confused about matplotlibs <code>plt</code>, <code>fig(ure)</code> and <code>ax(arr)</code>. What is really the difference?</p>
  
  <p>In most cases, for some "quick'n'dirty' plotting I see people using just <code>pyplot as plt</code> and directly plot with <code>plt.plot</code>. Since I am having multiple stuff to plot quite often, I frequently use <code>f, axarr = plt.subplots()</code>...but most times you see only code putting data into the <code>axarr</code> and ignoring the figure <code>f</code>.</p>
  
  <p>So, my question is: what is a clean way to work with matplotlib? When to use <code>plt</code> only, what is or what should a <code>figure</code> be used for? Should subplots just containing data? Or is it valid and good practice to everything like styling, clearing a plot, ..., inside of subplots?</p>
  
  <p>I hope this is not to wide-ranging. Basically I am asking for some advice for the true purposes of <code>plt</code> &lt;-> <code>fig</code> &lt;-> <code>ax(arr)</code> (and when/how to use them properly).</p>
  
  <p>Tutorials would also be welcome. The matplotlib documentation is rather confusing to me. When one searches something really specific, like rescaling a legend, different plot markers and colors and so on the official documentation is really precise but rather general information is not that good in my opinion. Too much different examples, no real explanations of the purposes...looks more or less like a big listing of all possible API methods and arguments.</p>