PlotDesign

(Source code, png)

../../_images/PlotDesign.png
PlotDesign(design, bounds=None, subdivisions=None, figure=None, axes=[], plot_kw=None, axes_kw=None, text_kw=None, enableTicks=True)

Plot a design using a scatter plot. If the dimension is equal to 2, then plots the 2D projection. If the dimension is greater or equal to 3, then plots all 2D projections.

In addition, the function plots a grid, i.e. horizontal and vertical lines to see the dispersion of the points. This allows one to see how the sample fills the space.

Parameters:
design2-d sequence of float

The sample.

figurea Matplotlib figure, optional

If this is not None, then create a new figure. Otherwise, use the existing figure.

axesa Matplotlib axis, optional

If empty, then create new axes.

boundsInterval, optional

Bounds of the plot. By default, compute the bounds from the sample.

subdivisionsa list of integers, optional

Number of subdivisions in the each direction. By default, set the number of subdivisions in each direction as equal to the sample size.

enableTicksbool, optional

A boolean. If True, then the ticks are plotted.

Returns:
figmatplotlib figure

Figure representing the sample.

Examples

Plot a sample in 2 dimensions.

>>> import openturns as ot
>>> from openturns.viewer import PlotDesign
>>> dim = 2
>>> X = [ot.Uniform()] * dim
>>> distribution = ot.JointDistribution(X)
>>> sampleSize = 10
>>> sample = distribution.getSample(sampleSize)
>>> fig = PlotDesign(sample)

Plot a sample in 5 dimensions.

>>> import openturns as ot
>>> from openturns.viewer import PlotDesign
>>> dim = 5
>>> size = 10
>>> distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)]*dim)
>>> bounds = distribution.getRange()
>>> lhs = ot.LHSExperiment(distribution, size)
>>> sample = lhs.generate()
>>> subdivisions = [size]*dim
>>> fig = PlotDesign(sample, bounds, subdivisions)

Examples using the function

The PlotDesign method

The PlotDesign method

Various design of experiments

Various design of experiments