When we want to put legend somewhere in a figure using Matplotlib, most of the time, the option loc='best' will produce the desired results. However, sometimes, we may want to have finer control over where the legend should be in the image. For example, we may want to put the legend outside of the axes, which is impossible using loc='best'.
Creating animations with Python's Matplotlib is quick and easy once you know how to do it. However, when learning I found the tutorials and examples online either daunting, overly sophisticated, or lacking explanation. In many cases all I need is a quick-and-dirty script that works, rather than longer code that adheres to best practices. See…