plotter

class Frame(var, x_range=None, nbins=None, name=None, display=None, trans=None, **extra)[source]

Bases: object

get_histogram(data, partial=None, bin_scale=1)[source]
set_axis(axis, **config)[source]
class PlotAllData(amp, data, phsp, bg=None, res=None, use_weighted=False)[source]

Bases: object

get_all_histogram(var, bin_scale=3)[source]
class PlotData(dataset, weight=None, partial_weight=None, use_weighted=False)[source]

Bases: object

get_histogram(var, partial=None, **kwargs)[source]
total_size()[source]
class PlotDataGroup(datasets)[source]

Bases: object

get_histogram(var, partial=None, **kwargs)[source]
total_size()[source]
class Plotter(config, legend_file=None, res=None, datasets=None, use_weighted=False)[source]

Bases: object

add_ref_amp(ref_amp, name='reference fit')[source]
forzen_style()[source]
get_all_hist(frame, idx=None, bin_scale=3)[source]

create all partial wave histogram for observation frame.

Parameters:
  • name (Frame, or callable) – Function for get observation in datasets

  • idx (int, optional) – data index, None for all data, defaults to None

  • bin_scale (float, optional) – smooth bin scale, defaults to 3

Returns:

collection of histogram

Return type:

dict

get_label(key)[source]
get_plot_style(example_hist)[source]
get_res_style(key)[source]
old_style(extra_config=None, color_first=True)[source]

context for base style, see matplotlib.rcParams for more configuration

Parameters:
  • extra_config (ditc, optional) – new configs, defaults to None

  • color_first (bool, optional) – order of color and linestyle, defaults to True

plot_frame(name, idx=None, ax=<module 'matplotlib.pyplot' from '/home/docs/checkouts/readthedocs.org/user_builds/tf-pwa/envs/latest/lib/python3.10/site-packages/matplotlib/pyplot.py'>, bin_scale=3)[source]

plot frame for all partial wave

Parameters:
  • name (str) – data variable frame name

  • idx (int, optional) – data index, None for all data, defaults to None

  • bin_scale (float, optional) – smooth bin scale, defaults to 3

  • ax (matplotlib.Axes, optional) – plot on axis ax

Returns:

matplotlib.Axes

plot_frame_with_pull(name, idx=None, bin_scale=3, pull_config=None)[source]

plot frame with pull for all partial wave

Parameters:
  • name (str) – data variable frame name

  • idx (int, optional) – data index, None for all data, defaults to None

  • bin_scale (float, optional) – smooth bin scale, defaults to 3

  • pull_config (dict, optional) – pull plot style, defaults to None

Returns:

matplotlib.Axes for plot and pull

plot_var(frame, idx=None, ax=<module 'matplotlib.pyplot' from '/home/docs/checkouts/readthedocs.org/user_builds/tf-pwa/envs/latest/lib/python3.10/site-packages/matplotlib/pyplot.py'>, bin_scale=3)[source]

plot data observation for all partial wave

Parameters:
  • name (Frame, or callable) – Function for get observation in datasets

  • idx (int, optional) – data index, None for all data, defaults to None

  • bin_scale (float, optional) – smooth bin scale, defaults to 3

  • ax (matplotlib.Axes, optional) – plot axis

Returns:

save_all_frame(prefix='figure/', format='png', idx=None, plot_pull=False, pull_config=None)[source]

Save all frame in with prefix. like ConfigLoader.plot_partial_waves

Parameters:
  • prefix (str, optional) – prefix for file name, defaults to “figure/”

  • format (str, optional) – figure format, defaults to “png”

  • idx (int, optional) – dataset index, defaults to None

  • plot_pull (bool, optional) – if plot pulls, defaults to False

  • pull_config (dict, optional) – configuration for plot pulls, defaults to None

set_plot_item(example_hist)[source]
class StyleSet(file_name)[source]

Bases: object

generate_new_style()[source]
get(key, value=None)[source]
save()[source]
set(key, value)[source]
get_all_frame(self)[source]
get_all_plotdatas(self, data=None, phsp=None, bg=None, res=None, use_weighted=False)[source]
get_plotter(self, legend_file=None, res=None, datasets=None, use_weighted=False)[source]
merge_hist(hists)[source]