.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_reliability_sensitivity/design_of_experiments/plot_plot_design.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_reliability_sensitivity_design_of_experiments_plot_plot_design.py: The PlotDesign method ===================== The goal of this example is to present the features of the PlotDesign static method. .. GENERATED FROM PYTHON SOURCE LINES 9-11 Distribution ------------ .. GENERATED FROM PYTHON SOURCE LINES 13-19 .. code-block:: Python import matplotlib.pyplot as plt import openturns as ot import openturns.viewer as otv ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 20-22 In two dimensions ----------------- .. GENERATED FROM PYTHON SOURCE LINES 24-28 .. code-block:: Python dim = 2 X = [ot.Uniform()] * dim distribution = ot.ComposedDistribution(X) .. GENERATED FROM PYTHON SOURCE LINES 29-32 .. code-block:: Python sampleSize = 10 sample = distribution.getSample(sampleSize) .. GENERATED FROM PYTHON SOURCE LINES 33-34 With default parameters the bounds are computed from the sample. .. GENERATED FROM PYTHON SOURCE LINES 36-38 .. code-block:: Python fig = otv.PlotDesign(sample) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_001.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 39-40 Set the bounds. .. GENERATED FROM PYTHON SOURCE LINES 42-44 .. code-block:: Python bounds = distribution.getRange() .. GENERATED FROM PYTHON SOURCE LINES 45-47 .. code-block:: Python fig = otv.PlotDesign(sample, bounds) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_002.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 48-49 Configure the size of the plot. .. GENERATED FROM PYTHON SOURCE LINES 51-54 .. code-block:: Python fig = otv.PlotDesign(sample) fig.set_size_inches(10, 10) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_003.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 55-56 Configure the number of subdivisions in each direction. .. GENERATED FROM PYTHON SOURCE LINES 58-60 .. code-block:: Python fig = otv.PlotDesign(sample, subdivisions=[10, 5]) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_004.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_004.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 61-62 Disable the ticks. .. GENERATED FROM PYTHON SOURCE LINES 64-66 .. code-block:: Python fig = otv.PlotDesign(sample, enableTicks=False) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_005.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_005.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 67-68 Configure the marker. .. GENERATED FROM PYTHON SOURCE LINES 70-72 .. code-block:: Python fig = otv.PlotDesign(sample, plot_kw={"marker": ".", "color": "red"}) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_006.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_006.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 73-74 Create the figure beforehand. .. GENERATED FROM PYTHON SOURCE LINES 76-80 .. code-block:: Python fig = plt.figure() fig.suptitle("My suptitle") fig = otv.PlotDesign(sample, figure=fig) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_007.png :alt: My suptitle :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_007.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 81-83 In three dimensions ------------------- .. GENERATED FROM PYTHON SOURCE LINES 85-89 .. code-block:: Python dim = 3 X = [ot.Uniform()] * dim distribution = ot.ComposedDistribution(X) .. GENERATED FROM PYTHON SOURCE LINES 90-93 .. code-block:: Python sampleSize = 10 sample = distribution.getSample(sampleSize) .. GENERATED FROM PYTHON SOURCE LINES 94-97 .. code-block:: Python fig = otv.PlotDesign(sample) fig.set_size_inches(10, 10) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_008.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_008.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 98-99 Configure the number of subdivisions. .. GENERATED FROM PYTHON SOURCE LINES 101-104 .. code-block:: Python fig = otv.PlotDesign(sample, subdivisions=[12, 6, 3]) fig.set_size_inches(10, 10) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_009.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_009.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 105-106 Configure the bounds. .. GENERATED FROM PYTHON SOURCE LINES 108-112 .. code-block:: Python bounds = distribution.getRange() fig = otv.PlotDesign(sample, bounds) fig.set_size_inches(10, 10) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_010.png :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_010.png :class: sphx-glr-single-img .. _sphx_glr_download_auto_reliability_sensitivity_design_of_experiments_plot_plot_design.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_plot_design.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_plot_design.py `