.. 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-18 .. code-block:: Python import matplotlib.pyplot as plt import openturns as ot import openturns.viewer as otv .. GENERATED FROM PYTHON SOURCE LINES 19-21 In two dimensions ----------------- .. GENERATED FROM PYTHON SOURCE LINES 23-27 .. code-block:: Python dim = 2 X = [ot.Uniform()] * dim distribution = ot.JointDistribution(X) .. GENERATED FROM PYTHON SOURCE LINES 28-31 .. code-block:: Python sampleSize = 10 sample = distribution.getSample(sampleSize) .. GENERATED FROM PYTHON SOURCE LINES 32-33 With default parameters the bounds are computed from the sample. .. GENERATED FROM PYTHON SOURCE LINES 35-37 .. code-block:: Python fig = otv.PlotDesign(sample) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_001.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_001.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 38-39 Set the bounds. .. GENERATED FROM PYTHON SOURCE LINES 41-43 .. code-block:: Python bounds = distribution.getRange() .. GENERATED FROM PYTHON SOURCE LINES 44-46 .. code-block:: Python fig = otv.PlotDesign(sample, bounds) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_002.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_002.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 47-48 Configure the size of the plot. .. GENERATED FROM PYTHON SOURCE LINES 50-53 .. 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.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_003.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 54-55 Configure the number of subdivisions in each direction. .. GENERATED FROM PYTHON SOURCE LINES 57-59 .. 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.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_004.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 60-61 Disable the ticks. .. GENERATED FROM PYTHON SOURCE LINES 63-65 .. code-block:: Python fig = otv.PlotDesign(sample, enableTicks=False) .. image-sg:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_005.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_005.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 66-67 Configure the marker. .. GENERATED FROM PYTHON SOURCE LINES 69-71 .. 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.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_006.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 72-73 Create the figure beforehand. .. GENERATED FROM PYTHON SOURCE LINES 75-79 .. 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.svg :alt: My suptitle :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_007.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 80-82 In three dimensions ------------------- .. GENERATED FROM PYTHON SOURCE LINES 84-88 .. code-block:: Python dim = 3 X = [ot.Uniform()] * dim distribution = ot.JointDistribution(X) .. GENERATED FROM PYTHON SOURCE LINES 89-92 .. code-block:: Python sampleSize = 10 sample = distribution.getSample(sampleSize) .. GENERATED FROM PYTHON SOURCE LINES 93-96 .. 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.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_008.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 97-98 Configure the number of subdivisions. .. GENERATED FROM PYTHON SOURCE LINES 100-103 .. 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.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_009.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 104-105 Configure the bounds. .. GENERATED FROM PYTHON SOURCE LINES 107-111 .. 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.svg :alt: plot plot design :srcset: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_010.svg :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 ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_plot_design.zip `