The DrawPairsWithGrid method

The goal of this example is to present the features of the DrawPairsWithGrid method.

Distribution

import openturns as ot
import openturns.viewer as otv

In two dimensions

dim = 2
X = [ot.Uniform()] * dim
distribution = ot.JointDistribution(X)
sampleSize = 10
sample = distribution.getSample(sampleSize)

With default parameters the bounds are computed from the sample and 5 subdivisions are used in each direction.

plot plot design

Set the bounds.

plot plot design

Configure the number of subdivisions in each direction.

plot plot design

Configure the marker.

grid = ot.VisualTest.DrawPairsWithGrid(sample, bounds)
view = otv.View(grid, scatter_kw={"marker": ".", "color": "red"})
plot plot design

In three dimensions

dim = 3
X = [ot.Uniform()] * dim
distribution = ot.JointDistribution(X)
sampleSize = 10
sample = distribution.getSample(sampleSize)
plot plot design

Configure the number of subdivisions.

grid = ot.VisualTest.DrawPairsWithGrid(sample, ot.Interval(), [12, 6, 3])
view = otv.View(grid)
view.getFigure().set_size_inches(10, 10)
plot plot design

Configure the bounds.

plot plot design

Display all figures