ndawe/rootpy — Issue #11: Some Changes to rootpy.plotting
Author: jklukas
Created: 2012-01-26 16:09:20+00:00
State: open

I want to flesh out the root2matplotlib stuff and integrate rootplot into rootpy within the next month so I can use that machinery to produce plots for my thesis which will need to have a full draft by mid-March. Before I work on those in earnest, though, I would like to make the plotting machinery a bit more coherent, and there are a few changes I think are necessary.

First, I think all the colors and styles for `Hist`, `Graph`, etc. should be handled through the existing `SetLineColor`, `GetLineColor`, etc. methods. I've developed `Color`, `LineStyle`, etc. classes which group the root and matplotlib variants together into one object which handles the conversions and have made those objects private members of the `Plottable` mixin. Thus, instead of having `linecolor`, `linecolormpl` and `GetLineColor()`, there is just a `_linecolor` object which can be accessed through `GetLineColor(mode)`.

I've commited the changes above to my fork:
https://github.com/jklukas/rootpy/commit/fad9320a8b87143565fe410d1ea0b42e26d56bad

Next, it looks like Noel has made some good updates to `root2matplotlib.py`. I have some thoughts on a consistent interface for these functions, though, that would break some of the options that have been added. For consistency, I think the functions like `hist` and `bar` should accept either a `Hist` or a `HistStack`, in which case it just overlays the histograms rather than stacking them, then the `histstack` and `barstack`-type functions would do the stacked versions.

For the `barstack` function, I would replace the `show_errors` and `errors_on_top` kwargs with a `yerr` kwarg that could take values perhaps like 'separate', 'combined', and None, which would be simpler. Obviously, these options will need to be documented in the docstring for the function.

Once this seems stable, I will try to flesh out the docstrings, and eventually to update the online docs to pull all that info as well.

Please let me know if you have objections.