plotting

Contents

plotting#

Base classes for different types of plotting tasks.

Classes:

PlotBase(*args, **kwargs)

Base class for all plotting tasks.

PlotBase1D(*args, **kwargs)

Base class for plotting tasks creating 1-dimensional plots.

PlotBase2D(*args, **kwargs)

Base class for plotting tasks creating 2-dimensional plots.

ProcessPlotSettingMixin(*args, **kwargs)

Mixin class for tasks creating plots where contributions of different processes are shown.

VariablePlotSettingMixin(*args, **kwargs)

Mixin class for tasks creating plots for multiple variables.

class PlotBase(*args, **kwargs)[source]#

Bases: ConfigTask

Base class for all plotting tasks.

Attributes:

plot_function

file_types

plot_suffix

view_cmd

general_settings

custom_style_config

skip_legend

cms_label

exclude_index

exclude_params_index

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

Methods:

resolve_param_values(params)

get_plot_parameters()

rtype:

DotDict

get_plot_names(name)

Returns a list of basenames for created plots given a file name for all configured file types, plus the additional plot suffix.

get_plot_func(func_name)

Returns a function, imported from a module given func_name which should have the format <module_to_import>.<function_name>.

call_plot_func(func_name, **kwargs)

Gets the plot function referred to by func_name via get_plot_func(), calls it with all kwargs and returns its result.

update_plot_kwargs(kwargs)

Hook to update keyword arguments kwargs used for plotting in call_plot_func().

plot_function = <luigi.parameter.Parameter object>#
file_types = <law.parameter.CSVParameter object>#
plot_suffix = <luigi.parameter.Parameter object>#
view_cmd = <luigi.parameter.Parameter object>#
general_settings = <columnflow.tasks.framework.parameters.SettingsParameter object>#
custom_style_config = <luigi.parameter.Parameter object>#
skip_legend = <law.parameter.OptionalBoolParameter object>#
cms_label = <luigi.parameter.Parameter object>#
classmethod resolve_param_values(params)[source]#
get_plot_parameters()[source]#
Return type:

DotDict

get_plot_names(name)[source]#

Returns a list of basenames for created plots given a file name for all configured file types, plus the additional plot suffix.

Return type:

list[str]

get_plot_func(func_name)[source]#

Returns a function, imported from a module given func_name which should have the format <module_to_import>.<function_name>.

Return type:

Callable

call_plot_func(func_name, **kwargs)[source]#

Gets the plot function referred to by func_name via get_plot_func(), calls it with all kwargs and returns its result. kwargs are updated through the update_plot_kwargs() hook first.

Return type:

Any

update_plot_kwargs(kwargs)[source]#

Hook to update keyword arguments kwargs used for plotting in call_plot_func().

Return type:

dict

exclude_index = False#
exclude_params_index = {}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
class PlotBase1D(*args, **kwargs)[source]#

Bases: PlotBase

Base class for plotting tasks creating 1-dimensional plots.

Attributes:

skip_ratio

density

yscale

shape_norm

hide_errors

exclude_index

exclude_params_index

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

Methods:

get_plot_parameters()

rtype:

DotDict

skip_ratio = <law.parameter.OptionalBoolParameter object>#
density = <law.parameter.OptionalBoolParameter object>#
yscale = <luigi.parameter.ChoiceParameter object>#
shape_norm = <law.parameter.OptionalBoolParameter object>#
hide_errors = <law.parameter.OptionalBoolParameter object>#
get_plot_parameters()[source]#
Return type:

DotDict

exclude_index = False#
exclude_params_index = {}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
class PlotBase2D(*args, **kwargs)[source]#

Bases: PlotBase

Base class for plotting tasks creating 2-dimensional plots.

Attributes:

zscale

density

shape_norm

colormap

zlim

extremes

extreme_colors

exclude_index

exclude_params_index

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

Methods:

modify_param_values(params)

Hook to modify command line arguments before instances of this class are created.

get_plot_parameters()

rtype:

DotDict

zscale = <luigi.parameter.ChoiceParameter object>#
density = <law.parameter.OptionalBoolParameter object>#
shape_norm = <law.parameter.OptionalBoolParameter object>#
colormap = <luigi.parameter.Parameter object>#
zlim = <law.parameter.CSVParameter object>#
extremes = <luigi.parameter.ChoiceParameter object>#
extreme_colors = <law.parameter.CSVParameter object>#
classmethod modify_param_values(params)[source]#

Hook to modify command line arguments before instances of this class are created.

Return type:

dict

get_plot_parameters()[source]#
Return type:

DotDict

exclude_index = False#
exclude_params_index = {}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
class ProcessPlotSettingMixin(*args, **kwargs)[source]#

Bases: DatasetsProcessesMixin, PlotBase

Mixin class for tasks creating plots where contributions of different processes are shown.

Attributes:

process_settings

exclude_index

exclude_params_index

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

Methods:

resolve_param_values(params)

get_plot_parameters()

rtype:

DotDict

process_settings = <columnflow.tasks.framework.parameters.MultiSettingsParameter object>#
classmethod resolve_param_values(params)[source]#
get_plot_parameters()[source]#
Return type:

DotDict

exclude_index = False#
exclude_params_index = {}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#
class VariablePlotSettingMixin(*args, **kwargs)[source]#

Bases: VariablesMixin, PlotBase

Mixin class for tasks creating plots for multiple variables.

Attributes:

variable_settings

exclude_index

exclude_params_index

exclude_params_repr

exclude_params_repr_empty

exclude_params_req

exclude_params_req_get

exclude_params_req_set

exclude_params_sandbox

Methods:

resolve_param_values(params)

get_plot_parameters()

rtype:

DotDict

variable_settings = <columnflow.tasks.framework.parameters.MultiSettingsParameter object>#
classmethod resolve_param_values(params)[source]#
get_plot_parameters()[source]#
Return type:

DotDict

exclude_index = False#
exclude_params_index = {}#
exclude_params_repr = {}#
exclude_params_repr_empty = {}#
exclude_params_req = {}#
exclude_params_req_get = {}#
exclude_params_req_set = {}#
exclude_params_sandbox = {'log_file', 'sandbox'}#