rootpy/rootpy — pull request #596 by chrisboo (2014-06-27 12:28:09+00:00)
Title: Optionally add a color bar to the 2D matplotlib plots created with hist2d and imshow

By default, the plot produced with the rplt.hist2d and rplt.imshow do not have a colorbar (legend). I see how there are some use cases where one does not want to have a colorbar with each plot (eg. http://www.rootpy.org/auto_examples/plotting/plot_matplotlib_hist2d.html). However, I found it rather inconvenient that actually precise knowledge of matplotlib was needed to add that bar when all one wanted to do is get a quick overview of the histogram. Therefore, I added the option "add_cbar" to to these two functions which defaults to False to not break backwards compatibility. If set to True, a colorbar is added to the produced plots without any knowledge of the inner workings required.