eva.plotting.emcpy.plot_tools package#

Submodules#

eva.plotting.emcpy.plot_tools.dynamic_config module#

eva.plotting.emcpy.plot_tools.dynamic_config.histogram_bins(logger, option_dict, plots_dict, data_collections)[source]#

Computes the number of bins for a histogram based on the provided data variable.

Parameters:
  • logger (Logger) – An instance of the logger for logging messages.

  • option_dict (dict) – A dictionary containing various options for the transformation.

  • plots_dict (dict) – A dictionary containing plot-related information.

  • data_collections (DataCollections) – An instance of the DataCollections class containing

  • data. (input) –

Returns:

A dictionary with the number of bins for the histogram.

Return type:

dict

This function computes the number of bins for a histogram based on the provided data variable. It applies various rules to calculate the appropriate number of bins and updates the provided plots dictionary with the calculated value.

Example

option_dict = {
    'data variable': 'my_collection::my_variable',
    'number of bins rule': 'sturges'
}
plots_dict = {
    'dynamic_bins': '10'
}
adjusted_plots_dict = histogram_bins(logger, option_dict, plots_dict,
                                     data_collections)
eva.plotting.emcpy.plot_tools.dynamic_config.vminvmaxcmap(logger, option_dict, plots_dict, data_collections)[source]#

Computes colormap limits and adjustments based on provided data variable.

Parameters:
  • logger (Logger) – An instance of the logger for logging messages.

  • option_dict (dict) – A dictionary containing various options for the transformation.

  • plots_dict (dict) – A dictionary containing plot-related information.

  • data_collections (DataCollections) – An instance of the DataCollections class containing

  • data. (input) –

Returns:

A dictionary with adjusted values for colormap limits and colormap.

Return type:

dict

This function computes colormap limits and adjustments based on the provided data variable. It calculates the minimum and maximum values for colormap limits, determines whether a sequential or diverging colormap should be used, and updates the provided plots dictionary with the adjusted values.

Example

option_dict = {
    'percentage capture': 95,
    'data variable': 'my_collection::my_variable',
    'sequential colormap': 'plasma',
    'diverging colormap': 'coolwarm'
}
plots_dict = {
    'dynamic_vmax': '1.0',
    'dynamic_vmin': '-1.0',
    'dynamic_cmap': 'viridis'
}
adjusted_plots_dict = vminvmaxcmap(logger, option_dict, plots_dict,
                                   data_collections)

eva.plotting.emcpy.plot_tools.figure_driver module#

eva.plotting.emcpy.plot_tools.figure_driver.figure_driver(config, data_collections, timing, logger)[source]#

Generates and saves multiple figures based on the provided configuration.

Parameters:
  • config (dict) – A dictionary containing the configuration for generating figures.

  • data_collections (DataCollections) – An instance of the DataCollections class containing

  • data. (input) –

  • timing (Timing) – A timing instance to measure the execution time.

  • logger (Logger) – An instance of the logger for logging messages.

This function generates and saves multiple figures based on the provided configuration. It processes each graphic specified in the configuration and creates corresponding figures with plots.

eva.plotting.emcpy.plot_tools.figure_driver.get_output_file(figure_conf)[source]#

Gets the output file path for saving the figure.

Parameters:

figure_conf (dict) – A dictionary containing the figure configuration.

Returns:

The complete path for saving the figure.

Return type:

output_file (str)

This function constructs the complete file path for saving the generated figure based on the provided figure configuration.

Example

figure_conf = {
    "output path": "./output_folder",
    "output name": "example_figure"
}
output_file = get_output_file(figure_conf)
eva.plotting.emcpy.plot_tools.figure_driver.get_saveargs(figure_conf)[source]#

Gets arguments for saving a figure based on the provided configuration.

Parameters:

figure_conf (dict) – A dictionary containing the figure configuration.

Returns:

A dictionary containing arguments for saving the figure.

Return type:

out_conf (dict)

This function extracts relevant arguments from the provided figure configuration to be used for saving the generated figure.

Example

figure_conf = {
    "layout": [2, 2],
    "figure file type": "png",
    "output path": "./output_folder",
    "output name": "example_figure"
}
save_args = get_saveargs(figure_conf)
eva.plotting.emcpy.plot_tools.figure_driver.make_figure(figure_conf, plots, dynamic_options, data_collections, logger)[source]#

Generates a figure based on the provided configuration and plots.

Parameters:
  • figure_conf (dict) – A dictionary containing the configuration for the figure layout and appearance.

  • plots (list) – A list of dictionaries containing plot configurations.

  • dynamic_options (list) – A list of dictionaries containing dynamic configuration options.

  • data_collections (DataCollections) – An instance of the DataCollections class containing

  • data. (input) –

  • logger (Logger) – An instance of the logger for logging messages.

This function generates a figure based on the provided configuration and plot settings. It processes the specified plots, applies dynamic options, and saves the generated figure.

Module contents#