Skip to content

5. ReadROOT's RootPlotter

Chloé Legué edited this page Jul 12, 2023 · 1 revision

The RootPlotter

The RootPlotter class is basically a matplotlib graph made for 2D histograms. Giving a set of data in x and in y, the RootPlotter will graph the 2D histogram in an efficient way. The RootPlotter has a few useful functions that can be used for customization.

RootPlotter.select_cmap

This function allows you to select any of the matplotlib colormaps. If you have registered a custom colormap, those can also be used.

RootPlotter.plot

This function requires two sets of data, one in x, one in y. Aside from the data, an integer representing the number of bins used for the 1D histogram is needed.

RootPlotter.set_title

This function allows you to set the graph's title. This will use the matplotlib function suptitle to make your selected title the main title of your graph.

RootPlotter.set_labels

This function requires 4 labels, two for the 2D histogram and 2 for the X axis and Y axis 1D histograms.

RootPlotter.show

This function will force the figure to be shown if it wasn't already.

Clone this wiki locally