.. 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 Click :ref:`here ` 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-21 .. code-block:: default import matplotlib.pyplot as plt import openturns as ot import openturns.viewer as otv import pylab as pl import openturns.viewer as viewer from matplotlib import pylab as plt ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 22-24 In two dimensions ----------------- .. GENERATED FROM PYTHON SOURCE LINES 26-30 .. code-block:: default dim = 2 X = [ot.Uniform()] * dim distribution = ot.ComposedDistribution(X) .. GENERATED FROM PYTHON SOURCE LINES 31-34 .. code-block:: default sampleSize = 10 sample = distribution.getSample(sampleSize) .. GENERATED FROM PYTHON SOURCE LINES 35-36 With default parameters the bounds are computed from the sample. .. GENERATED FROM PYTHON SOURCE LINES 38-40 .. code-block:: default 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 41-42 Set the bounds. .. GENERATED FROM PYTHON SOURCE LINES 44-46 .. code-block:: default bounds = distribution.getRange() .. GENERATED FROM PYTHON SOURCE LINES 47-49 .. code-block:: default 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 50-51 Configure the size of the plot. .. GENERATED FROM PYTHON SOURCE LINES 53-56 .. code-block:: default 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 57-58 Configure the number of subdivisions in each direction. .. GENERATED FROM PYTHON SOURCE LINES 60-62 .. code-block:: default 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 63-64 Disable the ticks. .. GENERATED FROM PYTHON SOURCE LINES 66-68 .. code-block:: default 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 69-70 Configure the marker. .. GENERATED FROM PYTHON SOURCE LINES 72-74 .. code-block:: default 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 75-76 Create the figure beforehand. .. GENERATED FROM PYTHON SOURCE LINES 78-82 .. code-block:: default 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 83-85 In three dimensions ------------------- .. GENERATED FROM PYTHON SOURCE LINES 87-91 .. code-block:: default dim = 3 X = [ot.Uniform()] * dim distribution = ot.ComposedDistribution(X) .. GENERATED FROM PYTHON SOURCE LINES 92-95 .. code-block:: default sampleSize = 10 sample = distribution.getSample(sampleSize) .. GENERATED FROM PYTHON SOURCE LINES 96-99 .. code-block:: default 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 100-101 Configure the number of subdivisions. .. GENERATED FROM PYTHON SOURCE LINES 103-106 .. code-block:: default 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 107-108 Configure the bounds. .. GENERATED FROM PYTHON SOURCE LINES 110-114 .. code-block:: default 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 .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.641 seconds) .. _sphx_glr_download_auto_reliability_sensitivity_design_of_experiments_plot_plot_design.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_plot_design.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_plot_design.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_