.. 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 ===================== .. GENERATED FROM PYTHON SOURCE LINES 21-22 The goal of this example is to present the features of the PlotDesign static method. .. GENERATED FROM PYTHON SOURCE LINES 25-27 Distribution ------------ .. GENERATED FROM PYTHON SOURCE LINES 29-37 .. 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 38-40 In two dimensions ----------------- .. GENERATED FROM PYTHON SOURCE LINES 42-46 .. code-block:: default dim = 2 X = [ot.Uniform()] * dim distribution = ot.ComposedDistribution(X) .. GENERATED FROM PYTHON SOURCE LINES 47-50 .. code-block:: default sampleSize = 10 sample = distribution.getSample(sampleSize) .. GENERATED FROM PYTHON SOURCE LINES 51-52 With default parameters the bounds are computed from the sample. .. GENERATED FROM PYTHON SOURCE LINES 54-56 .. 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 57-58 Set the bounds. .. GENERATED FROM PYTHON SOURCE LINES 60-62 .. code-block:: default bounds = distribution.getRange() .. GENERATED FROM PYTHON SOURCE LINES 63-65 .. 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 66-67 Configure the size of the plot. .. GENERATED FROM PYTHON SOURCE LINES 69-72 .. 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 73-74 Configure the number of subdivisions in each direction. .. GENERATED FROM PYTHON SOURCE LINES 76-78 .. 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 79-80 Disable the ticks. .. GENERATED FROM PYTHON SOURCE LINES 82-84 .. 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 85-86 Configure the marker. .. GENERATED FROM PYTHON SOURCE LINES 88-90 .. 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 91-92 Create the figure beforehand. .. GENERATED FROM PYTHON SOURCE LINES 94-98 .. 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 99-101 In three dimensions ------------------- .. GENERATED FROM PYTHON SOURCE LINES 103-107 .. code-block:: default dim = 3 X = [ot.Uniform()] * dim distribution = ot.ComposedDistribution(X) .. GENERATED FROM PYTHON SOURCE LINES 108-111 .. code-block:: default sampleSize = 10 sample = distribution.getSample(sampleSize) .. GENERATED FROM PYTHON SOURCE LINES 112-115 .. 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 116-117 Configure the number of subdivisions. .. GENERATED FROM PYTHON SOURCE LINES 119-122 .. 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 123-124 Configure the bounds. .. GENERATED FROM PYTHON SOURCE LINES 126-130 .. 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 2.714 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 `_