plot

class LineStyleSet(file_name, color_first=True)[source]

Bases: object

get(id_, default=None)[source]
get_style(id_)[source]
save()[source]
build_read_var_function(all_var, where={})[source]
create_chain_property(self, res)[source]
create_plot_var_dic(plot_params, extra_plots=None)[source]
default_color_generator(color_first)[source]
export_legend(ax, filename='legend.pdf', ncol=1)[source]

export legend in Axis ax to file filename

get_chain_property(self, idx, display=True)[source]

Get chain name and curve style in plot

get_chain_property_v1(self, idx, display)[source]
get_chain_property_v2(self, idx, display)[source]
get_dalitz(config, a, b)[source]
get_dalitz_boundary(config, a, b, N=1000)[source]
hist_error(data, bins=50, xrange=None, weights=1.0, kind='poisson')[source]
hist_line(data, weights, bins, xrange=None, inter=1, kind='UnivariateSpline')[source]

interpolate data from hostgram into a line

>>> import numpy as np
>>> import matplotlib.pyplot
>>> z = np.random.normal(size=1000)
>>> x, y = hist_line(z, None, 50)
>>> a = plt.plot(x, y)
hist_line_step(data, weights, bins, xrange=None, inter=1, kind='quadratic')[source]
>>> import numpy as np
>>> import matplotlib.pyplot
>>> z = np.random.normal(size=1000)
>>> x, y = hist_line_step(z, None, 50)
>>> a = plt.step(x, y)
plot_adaptive_2dpull(config, var1, var2, binning=[[2, 2], [2, 2], [2, 2]], ax=<module 'matplotlib.pyplot' from '/home/docs/checkouts/readthedocs.org/user_builds/tf-pwa/envs/latest/lib/python3.10/site-packages/matplotlib/pyplot.py'>, where={}, cut_zero=True, plot_scatter=True, scatter_style={'c': 'black', 's': 1}, **kwargs)[source]
plot_function_2dpull(data_dict, phsp_dict, bg_dict, var1='x', var2='y', binning=[[2, 2], [2, 2], [2, 2]], where={}, ax=<module 'matplotlib.pyplot' from '/home/docs/checkouts/readthedocs.org/user_builds/tf-pwa/envs/latest/lib/python3.10/site-packages/matplotlib/pyplot.py'>, cut_zero=True, plot_scatter=True, scatter_style={'c': 'black', 's': 1}, cmap='jet', **kwargs)[source]
plot_partial_wave(self, params=None, data=None, phsp=None, bg=None, prefix='figure/', res=None, save_root=False, chains_id_method=None, phsp_rec=None, cut_function=<function <lambda>>, plot_function=None, **kwargs)[source]

plot partial wave plots

Parameters:
  • self – ConfigLoader object

  • params – params, dict or FitResutls

  • data – data sample, a list of CalAngleData

  • phsp – phase space sample, a list of CalAngleData (the same size as data)

  • bg – background sample, a list of CalAngleData (the same size as data)

  • prefix – figure saving folder and nameing prefix

  • res – combination of resonaces in partial wave, list of (list of (string for resoances name or int for decay chain index))

  • save_root – if save weights in a root file, bool

  • chains_id_method – method of how legend label display, string

  • bin_scale – more binning in partial waves for a smooth histogram. int

  • batch – batching in calculating weights, int

  • smooth – if plot smooth binned kde shape or histogram, bool

  • single_legend – if save all legend in a file “legend.pdf”, bool

  • plot_pull – if plot the pull distribution, bool

  • format – save figure with image format, string (such as “.png”, “.jpeg”)

  • linestyle_file – legend linestyle configuration file name (YAML format), string (such as “legend.yml”)

plot_partial_wave_interf(self, res1, res2, **kwargs)[source]