title: Matplotlib 2d histogram with statistics
body: <p>Is there an easy way to provide some basic statistics (RMS for x and y, total number of items etc.) in a legend, like ROOT does:</p>
  
  <p><img src="https://i.stack.imgur.com/zjRU7.png" alt="2D histogram created with ROOT"></p>
  
  <p>or should I calculate those values manually and add a textbox? How would I do that, since annotating with text needs many styling options and seems way too complicated for such a simple thing…</p>