DrawPairsWithGrid

(Source code, svg)

../../_images/DrawPairsWithGrid.svg
DrawPairsWithGrid(*args)

Draw 2-d projections of a design with grid lines in each plane.

Parameters:
sample2-d sequence of float

Design to draw, of dimension >= 2.

boundsInterval, optional

Bounds of the design in each direction, including outer grid edges. By default, bounds are computed from the sample.

subdivisionssequence of int, optional

Number of subdivisions in each direction, each >= 1. By default, 5 subdivisions in each direction.

Returns:
gridGridLayout

Grid of 2-d projections, each graph containing a Grid and a Cloud.

Notes

Each 2D projection shows the sample points over a uniform grid defined by bounds and subdivisions, including the outer edges. This allows one to see how the sample fills the space, e.g. the stratification of LHS or low-discrepancy sequences.

The default subdivisions (5 in each direction) keep large samples readable. For designs with a known stratification (e.g. LHS of size 10), set subdivisions to the design size in each direction.

If bounds is not given it is estimated from the sample, which is biased for uniform samples; providing the true bounds (e.g. the distribution range) is recommended.

Examples

>>> import openturns as ot
>>> from openturns.viewer import View
>>> ot.RandomGenerator.SetSeed(0)
>>> distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 3)
>>> sample = distribution.getSample(10)
>>> grid = ot.VisualTest.DrawPairsWithGrid(sample, distribution.getRange(), [10, 10, 10])
>>> View(grid).show()

Examples using the function

Various design of experiments

Various design of experiments

The DrawPairsWithGrid method

The DrawPairsWithGrid method