iceplot

Advanced histogram visualization functions.

iceplot.iceplot

binwidth(bins)[source]

Return binwidth from a linear array

change2density_labels(all_obs)[source]

Change to density ~ 1/N dN/dx [1/xdim] type label to y-axis

chi2_cost(h_mc, h_data, return_nbins=False)[source]

Chi2 cost function between two histograms

colors(i, power=0.34)[source]
create_axes(xlabel='$x$', ylabel='Counts', ylabel_ratio='Ratio', xlim=(0, 1), ylim=None, ratio_plot=True, figsize=(5, 4), fontsize=8, units={'x': '', 'y': ''}, **kwargs)[source]

Axes creator.

edge2centerbins(bins)[source]

Get centerbins from edgebins.

fuse_histograms(hist_list)[source]

Fuse a list of count histogram objects

generate_colormap()[source]

Default colormap.

hist(x, bins=30, density=False, weights=None)[source]

Calculate a histogram.

hist_filled_error(ax, bins, cbins, y, err, color, **kwargs)[source]

Stephist style error.

hist_obj(x, bins=30, weights=None)[source]

A wrapper to return a histogram object.

hist_to_density(counts, errs, bins)[source]

Normalize to unit integral density function over the visible histogram range

hist_to_density_fullspace(counts, errs, bins, totalweight)[source]

Normalize histogram to a unit integral density function over total sum of event weights (not just the visible histogram range mass)

histhepdata(hepdata, all_obs, scale=None, density=False, MC_XS_SCALE=1000000000000.0, label='Data', style={'histtype': 'step', 'ls': '-', 'lw': 1, 'zorder': 0})[source]
histmc(mcdata, all_obs, density=False, scale=None, color=(0, 0, 1), label='none', style={'histtype': 'step', 'ls': '-', 'lw': 1, 'zorder': 0})[source]

Over all observables of an MC sample

class hobj(counts=0, errs=0, bins=0, cbins=0, binscale=1.0)[source]

Minimal histogram data object.

integral()[source]
ordered_legend(ax=None, order=None, frameon=False, unique=False, **kwargs)[source]

Ordered legends.

plot_horizontal_line(ax, ypos=1.0, color=(0.5, 0.5, 0.5), linewidth=0.9)[source]

For the ratio plot

ratioerr(A, B, sigma_A, sigma_B, sigma_AB=0, EPS=1e-15)[source]

Ratio f(A,B) = A/B error, by Taylor expansion of f.

set_axis_ticks(ax, ticks, dim='x')[source]

Set ticks of the axis.

set_global_style(dpi=120, figsize=(4, 3.75), font='serif', font_size=8, legend_fontsize=7, legend_handlelength=1)[source]

Set global plot style.

stepspace(start, stop, step)[source]

Linear binning edges between [start, stop]

superplot(data, observable=None, ratio_plot=True, yscale='linear', ratio_error_plot=True, legend_counts=False, color=None, legend_properties={'fontsize': 7}, bottom_PRC=5, EPS=1e-12, verbose=False)[source]

Superposition (overlaid) plotting

test_iceplot()[source]

Visual unit tests

tick_calc(lim, step, N=6)[source]

Tick spacing calculator.

tick_creator(ax, xtick_step=None, ytick_step=None, ylim_ratio=(0.5, 1.5), ratio_plot=True, minorticks_on=True, ytick_ratio_step=0.25, labelsize=8, labelsize_ratio=7, **kwargs)[source]

Axis tick constructor.