File: t_PlotDesign.py

package info (click to toggle)
openturns 1.24-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,204 kB
  • sloc: cpp: 256,662; python: 63,381; ansic: 4,414; javascript: 406; sh: 180; xml: 164; yacc: 123; makefile: 98; lex: 55
file content (65 lines) | stat: -rwxr-xr-x 2,224 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#! /usr/bin/env python

from matplotlib import pyplot as plt

from openturns.viewer import PlotDesign
import openturns as ot

samplesize = 12

# Plot 2D - basic
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 2)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = PlotDesign(design)

# Plot 3D - basic
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 3)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = PlotDesign(design)

# Plot 2D - set bounds and subdivisions
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 2)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = PlotDesign(design, bounds, [10, 10])

# Plot 3D - set bounds and subdivisions
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 3)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = PlotDesign(design, bounds, [10, 10, 10])

# Plot 2D - advanced - enable ticks
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 2)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = PlotDesign(design, bounds, [10, 10], enableTicks=True)
fig.set_size_inches(12, 12)

# Plot 3D - advanced - enable ticks
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 3)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = PlotDesign(design, bounds, [10, 10, 10], enableTicks=True)
fig.set_size_inches(12, 12)

# Plot 2D - advanced - unequal number of divisions
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 2)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = PlotDesign(design, bounds, [10, 5])

# Plot 3D - advanced - unequal number of divisions
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 3)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = PlotDesign(design, bounds, [10, 5, 3])

# Plot 2D - set figure prior to calling the plot
distribution = ot.JointDistribution([ot.Uniform(0.0, 1.0)] * 2)
bounds = distribution.getRange()
design = distribution.getSample(samplesize)
fig = plt.figure()
fig = PlotDesign(design, figure=fig)