SALib.plotting package#

Submodules#

SALib.plotting.bar module#

SALib.plotting.bar.plot(Si_df, ax=None)[source]#

Create bar chart of results.

Examples

>>> from SALib.plotting.bar import plot as barplot
>>> from SALib.test_functions import Ishigami
>>>
>>> # See README for example problem specification
>>>
>>> X = saltelli.sample(problem, 512)
>>> Y = Ishigami.evaluate(X)
>>> Si = sobol.analyze(problem, Y, print_to_console=False)
>>> total, first, second = Si.to_df()
>>> barplot(total)
Parameters:

Si_df (*)

Returns:

* ax

Return type:

matplotlib axes object

SALib.plotting.hdmr module#

Created on Dec 20, 2019

@author: @sahin-abdullah

This submodule produces two different figures: (1) emulator vs simulator, (2) regression lines of first order component functions

SALib.plotting.hdmr.plot(Si)[source]#

SALib.plotting.heatmap module#

SALib.plotting.heatmap.heatmap(sp: Dict, metric: str, index: str, title: str = None, ax=None)[source]#

Plot a heatmap of the target metric.

Parameters:
  • sp (object, SALib ProblemSpec)

  • metric (str, metric to plot. Defaults to first metric/result output if None.)

  • index (str, sensitivity indices to plot (‘S1’, ‘ST’, etc). Displays all if None.)

  • title (str, plot title to use)

  • ax (axes object, matplotlib axes object to assign figure to.)

Returns:

ax

Return type:

matplotlib axes object

SALib.plotting.morris module#

Created on 29 Jun 2015

@author: @willu47

This module provides the basic infrastructure for plotting charts for the Method of Morris results

The procedures should build upon and return an axes instance:

import matplotlib.pyplot as plt
Si = morris.analyze(problem, param_values, Y, conf_level=0.95,
                    print_to_console=False, num_levels=10)

# set plot style etc.
fig, ax = plt.subplots(1)
p = SALib.plotting.morris.horizontal_bar_plot(ax, Si, {'marker':'x'})
p.show()
SALib.plotting.morris.covariance_plot(ax, Si, opts=None, unit='')[source]#

Plots mu* against sigma or the 95% confidence interval

SALib.plotting.morris.horizontal_bar_plot(ax, Si, opts=None, sortby='mu_star', unit='')[source]#

Updates a matplotlib axes instance with a horizontal bar plot of mu_star, with error bars representing mu_star_conf.

SALib.plotting.morris.sample_histograms(fig, input_sample, problem, opts=None)[source]#

Plots a set of subplots of histograms of the input sample

SALib.plotting.shapley module#

Bar chart for Shapley effects.

Raw Shapley effects (output-variance units) and their normalized shares (unit interval, summing to one) sit on incompatible scales, so plotting all four shapley/shapley_conf/shapley_normalized/ shapley_normalized_conf columns together in a single bar chart (the default behavior inherited from ResultDict.plot) makes the smaller series unreadable. This module plots one pair at a time instead, defaulting to the normalized shares since those are what’s usually of interest.

SALib.plotting.shapley.plot(Si, ax=None, normalized=True)[source]#

Plot Shapley effects as a bar chart.

Parameters:
  • Si (ResultDict) – Analysis results, as returned by SALib.analyze.shapley.analyze().

  • ax (matplotlib axes object, optional) – Axes to plot onto. Creates a new figure if not provided.

  • normalized (bool, default=True) – Plot the normalized shares (summing to one) rather than the raw effects in output-variance units.

Returns:

ax

Return type:

matplotlib axes object

Module contents#