Note
Go to the end to download the full example code
The PlotDesign method¶
The goal of this example is to present the features of the PlotDesign static method.
Distribution¶
import matplotlib.pyplot as plt
import openturns as ot
import openturns.viewer as otv
ot.Log.Show(ot.Log.NONE)
In two dimensions¶
dim = 2
X = [ot.Uniform()] * dim
distribution = ot.ComposedDistribution(X)
sampleSize = 10
sample = distribution.getSample(sampleSize)
With default parameters the bounds are computed from the sample.
fig = otv.PlotDesign(sample)
![plot plot design](../../_images/sphx_glr_plot_plot_design_001.png)
Set the bounds.
bounds = distribution.getRange()
fig = otv.PlotDesign(sample, bounds)
![plot plot design](../../_images/sphx_glr_plot_plot_design_002.png)
Configure the size of the plot.
fig = otv.PlotDesign(sample)
fig.set_size_inches(10, 10)
![plot plot design](../../_images/sphx_glr_plot_plot_design_003.png)
Configure the number of subdivisions in each direction.
fig = otv.PlotDesign(sample, subdivisions=[10, 5])
![plot plot design](../../_images/sphx_glr_plot_plot_design_004.png)
Disable the ticks.
fig = otv.PlotDesign(sample, enableTicks=False)
![plot plot design](../../_images/sphx_glr_plot_plot_design_005.png)
Configure the marker.
fig = otv.PlotDesign(sample, plot_kw={"marker": ".", "color": "red"})
![plot plot design](../../_images/sphx_glr_plot_plot_design_006.png)
Create the figure beforehand.
fig = plt.figure()
fig.suptitle("My suptitle")
fig = otv.PlotDesign(sample, figure=fig)
![My suptitle](../../_images/sphx_glr_plot_plot_design_007.png)
In three dimensions¶
dim = 3
X = [ot.Uniform()] * dim
distribution = ot.ComposedDistribution(X)
sampleSize = 10
sample = distribution.getSample(sampleSize)
fig = otv.PlotDesign(sample)
fig.set_size_inches(10, 10)
![plot plot design](../../_images/sphx_glr_plot_plot_design_008.png)
Configure the number of subdivisions.
fig = otv.PlotDesign(sample, subdivisions=[12, 6, 3])
fig.set_size_inches(10, 10)
![plot plot design](../../_images/sphx_glr_plot_plot_design_009.png)
Configure the bounds.
bounds = distribution.getRange()
fig = otv.PlotDesign(sample, bounds)
fig.set_size_inches(10, 10)
![plot plot design](../../_images/sphx_glr_plot_plot_design_010.png)
Total running time of the script: ( 0 minutes 1.592 seconds)