Skip to content

Stripes facets

daspi.plotlib.facets.StripesFacets(target, *, target_on_y, single_axes, stripes=[], mean=False, median=False, control_limits=False, spec_limits=SpecLimits(), confidence=None, strategy='norm', agreement=6, **kwds)

A class for creating location and spread width lines, specification limits and/or confidence interval areas as stripes on each Axes. The location and spread (and their confidence bands) represent the data per axes.

PARAMETER DESCRIPTION
target

The target data for the estimation.

TYPE: ArrayLike

target_on_y

Whether the target data is on the y-axis or not.

TYPE: bool

single_axes

Whether a single axis is used for the chart or whether the stripes are used on multiple axes. This affects how the predefined legend labels are handled. If True, the corresponding position values are added to the label.

TYPE: bool

stripes

Additional non-predefined stripes to be added to the chart, by default [].

TYPE: List[Type[Stripe]] DEFAULT: []

mean

Whether to include a mean line on the chart, by default False.

TYPE: bool DEFAULT: False

median

Whether to include a median line on the chart, by default False.

TYPE: bool DEFAULT: False

control_limits

Whether to include control limits on the chart, by default False.

TYPE: bool DEFAULT: False

spec_limits

The specification limits for the chart, by default SpecLimits().

TYPE: SpecLimits DEFAULT: SpecLimits()

confidence

The confidence level for the confidence intervals, by default None.

TYPE: float DEFAULT: None

strategy

Which strategy should be used to determine the control limits (process spread): - eval: The strategy is determined according to the given evaluate function. If none is given, the internal evaluate method is used. - fit: First, the distribution that best represents the process data is searched for and then the agreed process spread is calculated - norm: it is assumed that the data is subject to normal distribution. The variation tolerance is then calculated as agreement * standard deviation - data: The quantiles for the process variation tolerance are read directly from the data. by default 'norm'

TYPE: (eval, fit, norm, data) DEFAULT: 'eval'

agreement

Specify the tolerated process variation for which the control limits are to be calculated. If int, the spread is determined using the normal distribution agreementsigma, e.g. agreement = 6 -> 6sigma ~ covers 99.75 % of the data. The upper and lower permissible quantiles are then calculated from this. If float, the value must be between 0 and 1.This value is then interpreted as the acceptable proportion for the spread, e.g. 0.9973 (which corresponds to ~ 6 sigma) by default 6

TYPE: float or int DEFAULT: 6

**kwds

Additional keyword arguments to pass to the ProcessEstimator.

TYPE: dict DEFAULT: {}

single_axes = single_axes instance-attribute

Whether a single axis is used for the chart or whether the stripes are used on multiple axes. This affects how the predefined legend labels are handled. If True, the corresponding position values are added to the label.

estimation = ProcessEstimator(samples=target, spec_limits=spec_limits, strategy=strategy, agreement=agreement, **kwds) instance-attribute

The process estimator object.

target_on_y = target_on_y instance-attribute

Whether the target is on the y-axis or the x-axis.

stripes = {(s.identity): s for s in stripes} instance-attribute

The stripes to plot on the chart.

confidence property

Get the confidence level for the confidence intervals (read-only).

orientation property

The orientation of the chart.

add_mean_stripes(add_confidence_span)

Add mean stripes to the plot.

This method adds a stripe representing the mean of the target data, using the StripeLine class. If add_confidence_span is True, additional stripes representing the confidence interval for the mean will also be added using the StripeSpan class.

PARAMETER DESCRIPTION
add_confidence_span

Whether to add confidence stripes for the mean.

TYPE: bool

add_median_stripes(add_confidence_span)

Add median stripes to the plot.

This method adds a stripe representing the median of the target data, using the StripeLine class. If add_confidence_span is True, additional stripes representing the confidence interval for the median will also be added using the StripeSpan class.

PARAMETER DESCRIPTION
add_confidence_span

Whether to add confidence stripes for the median.

TYPE: bool

add_control_limit_stripes(add_confidence_span)

Add control limit stripes to the plot.

This method adds stripes representing the lower and upper control limits for the target data.

The stripes are added using the StripeLine class, with the label and position set based on the control limits from the estimation attribute. If add_confidence_span is True, additional stripes representing the confidence interval for the control limits will also be added using the StripeSpan class.

PARAMETER DESCRIPTION
add_confidence_span

Whether to add confidence stripes for the control limits.

TYPE: bool

add_specification_limit_stripes()

Add specification limit stripes to the plot.

This method adds stripes representing the lower and upper specification limits to the plot. If a specification limit is None, it will be skipped.

The stripes are added using the StripeLine class, with the label and position set based on the specification limits from the estimation attribute.

handles_labels()

Get the legend handles and labels for the plot.

This method processes the self.stripes dictionary to extract the legend handles and labels for the plot. It separates the handles and labels for line stripes and span stripes, and returns them as a tuple of handles and a tuple of labels.

RETURNS DESCRIPTION
LegendHandlesLabels

A tuple containing the legend handles and labels.

TYPE: LegendHandlesLabels

draw(ax)

Draw the stripes on the specified Axes.

PARAMETER DESCRIPTION
ax

The Axes on which to draw the stripes.

TYPE: Axes