.. 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. Distribution ------------ .. code-block:: default 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) In two dimensions ----------------- .. code-block:: default dim = 2 X = [ot.Uniform()] * dim distribution = ot.ComposedDistribution(X) .. code-block:: default sampleSize = 10 sample = distribution.getSample(sampleSize) With default parameters the bounds are computed from the sample. .. code-block:: default fig = otv.PlotDesign(sample); .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_001.png :alt: plot plot design :class: sphx-glr-single-img Set the bounds. .. code-block:: default bounds = distribution.getRange() .. code-block:: default fig = otv.PlotDesign(sample, bounds); .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_002.png :alt: plot plot design :class: sphx-glr-single-img Configure the size of the plot. .. code-block:: default fig = otv.PlotDesign(sample) fig.set_size_inches(10, 10) .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_003.png :alt: plot plot design :class: sphx-glr-single-img Configure the number of subdivisions in each direction. .. code-block:: default fig = otv.PlotDesign(sample, subdivisions = [10, 5]); .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_004.png :alt: plot plot design :class: sphx-glr-single-img Disable the ticks. .. code-block:: default fig = otv.PlotDesign(sample, enableTicks = False); .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_005.png :alt: plot plot design :class: sphx-glr-single-img Configure the marker. .. code-block:: default fig = otv.PlotDesign(sample, plot_kw = {"marker":'.', "color": "red"}); .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_006.png :alt: plot plot design :class: sphx-glr-single-img Create the figure beforehand. .. code-block:: default import matplotlib.pyplot as plt fig = plt.figure() fig.suptitle("My suptitle") fig = otv.PlotDesign(sample, figure = fig); .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_007.png :alt: My suptitle :class: sphx-glr-single-img In three dimensions ------------------- .. code-block:: default dim = 3 X = [ot.Uniform()] * dim distribution = ot.ComposedDistribution(X) .. code-block:: default sampleSize = 10 sample = distribution.getSample(sampleSize) .. code-block:: default fig = otv.PlotDesign(sample); fig.set_size_inches(10, 10) .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_008.png :alt: plot plot design :class: sphx-glr-single-img Configure the number of subdivisions. .. code-block:: default fig = otv.PlotDesign(sample, subdivisions = [12, 6, 3]); fig.set_size_inches(10, 10) .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_009.png :alt: plot plot design :class: sphx-glr-single-img Configure the bounds. .. code-block:: default bounds = distribution.getRange() fig = otv.PlotDesign(sample, bounds); fig.set_size_inches(10, 10) .. image:: /auto_reliability_sensitivity/design_of_experiments/images/sphx_glr_plot_plot_design_010.png :alt: plot plot design :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.536 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 `_