Plotting ROOT objects with matplotlib¶
The following code block defines some useful methods to plot ROOT objects.
from mpl_tools import bind
For the detailed instructions refer to the matplotlib documentation and reference to relevant functions (plot, bar, etc).
|
plot TH1* using |
|
same as above, but guess label from histogram’s title |
|
plot TH1* using |
|
plot TH1* using |
hist1a.bar(divide=3, shift=0, ...) hist1b.bar(divide=3, shift=1, ...) hist1c.bar(divide=3, shift=2, ...) |
plot three TH1* using |
autolabel
may be applied to all above commands.
|
plot TH2* |
|
same as above, adds a colorbar |
|
same as the first command. Do not colorize bins with value=0.0 (ROOT behaviour) |
|
plot TH2* |
|
plot TH2* |
colorbar
and mask
options may be applied to all above commands.
|
plot |
|
plot |