.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_data_analysis/graphics/plot_visualize_input_output_sample.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_data_analysis_graphics_plot_visualize_input_output_sample.py: Visualize pairs between two samples =================================== .. GENERATED FROM PYTHON SOURCE LINES 7-12 In this example we visualize the relationships between the marginal samples of two given samples. This is usual when we analyze the relationship of output sample of a model depending on input sample. This can be achieved by plotting the outputs versus the inputs. When there are several inputs (which is the most often encountered case) and several outputs (which is less often). The :meth:`~openturns.VisualTest.DrawPairsXY` method provides a tool to plot the pairs of input and output marginal samples and see the correlations graphically. .. GENERATED FROM PYTHON SOURCE LINES 14-19 .. code-block:: Python import openturns as ot import openturns.viewer as viewer ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 20-21 Create the model .. GENERATED FROM PYTHON SOURCE LINES 21-26 .. code-block:: Python model = ot.SymbolicFunction( ["X0", "X1", "X2"], ["1.0 + 2.0 * X0 - 1.0 * X1 + 4.0 * X2", "-2.0 - 3.0 * X0 + 5.0 * X1 - 1.0 * X2"], ) .. GENERATED FROM PYTHON SOURCE LINES 27-28 Create the input data to visualize .. GENERATED FROM PYTHON SOURCE LINES 28-32 .. code-block:: Python distribution = ot.Normal(3) distribution.setDescription(model.getInputDescription()) input_sample = distribution.getSample(100) .. GENERATED FROM PYTHON SOURCE LINES 33-35 .. code-block:: Python output_sample = model(input_sample) .. GENERATED FROM PYTHON SOURCE LINES 36-40 .. code-block:: Python graph = ot.VisualTest.DrawPairsXY(input_sample, output_sample) graph.setTitle("Clouds of input / output samples") view = viewer.View(graph) viewer.View.ShowAll() .. image-sg:: /auto_data_analysis/graphics/images/sphx_glr_plot_visualize_input_output_sample_001.png :alt: Clouds of input / output samples :srcset: /auto_data_analysis/graphics/images/sphx_glr_plot_visualize_input_output_sample_001.png :class: sphx-glr-single-img .. _sphx_glr_download_auto_data_analysis_graphics_plot_visualize_input_output_sample.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_visualize_input_output_sample.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_visualize_input_output_sample.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_visualize_input_output_sample.zip `