.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/correlated_examples/plot_0_0D11_dataset.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_examples_correlated_examples_plot_0_0D11_dataset.py: Scatter, 0D{1,1} dataset ^^^^^^^^^^^^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 6-15 We start with a 0D{1,1} correlated dataset, that is, a dataset without a coordinate grid. A 0D{1,1} dataset has no dimensions, d = 0, and two single-component dependent variables. In the following example [#f3]_, the two `correlated` dependent variables are the :math:`^{29}\text{Si}` - :math:`^{29}\text{Si}` nuclear spin couplings, :math:`^2J`, across a Si-O-Si linkage, and the `s`-character product on the O and two Si along the Si-O bond across the Si-O-Si linkage. Let's import the dataset. .. GENERATED FROM PYTHON SOURCE LINES 15-21 .. code-block:: Python import csdmpy as cp domain = "https://www.ssnmr.org/sites/default/files/CSDM" filename = f"{domain}/correlatedDataset/0D_dataset/J_vs_s.csdf" zero_d_dataset = cp.load(filename) .. GENERATED FROM PYTHON SOURCE LINES 22-25 Since the dataset has no dimensions, the value of the :attr:`~csdmpy.CSDM.dimensions` attribute of the :attr:`~csdmpy.CSDM` class is an empty tuple, .. GENERATED FROM PYTHON SOURCE LINES 25-27 .. code-block:: Python print(zero_d_dataset.dimensions) .. rst-class:: sphx-glr-script-out .. code-block:: none [] .. GENERATED FROM PYTHON SOURCE LINES 28-31 The :attr:`~csdmpy.CSDM.dependent_variables` attribute, however, holds two dependent-variable objects. The data structure from the two dependent variables is .. GENERATED FROM PYTHON SOURCE LINES 31-33 .. code-block:: Python print(zero_d_dataset.dependent_variables[0].data_structure) .. rst-class:: sphx-glr-script-out .. code-block:: none { "type": "internal", "name": "Gaussian computed J-couplings", "unit": "Hz", "quantity_name": "frequency", "numeric_type": "float32", "quantity_type": "scalar", "component_labels": [ "J-coupling" ], "components": [ [ "-1.87378, -1.42918, ..., 25.1742, 26.0608" ] ] } .. GENERATED FROM PYTHON SOURCE LINES 34-35 and .. GENERATED FROM PYTHON SOURCE LINES 35-37 .. code-block:: Python print(zero_d_dataset.dependent_variables[1].data_structure) .. rst-class:: sphx-glr-script-out .. code-block:: none { "type": "internal", "name": "product of s-characters", "unit": "%", "numeric_type": "float32", "quantity_type": "scalar", "component_labels": [ "s-character product" ], "components": [ [ "0.8457453, 0.8534185, ..., 1.5277092, 1.5289451" ] ] } .. GENERATED FROM PYTHON SOURCE LINES 38-39 respectively. .. GENERATED FROM PYTHON SOURCE LINES 41-45 **Visualizing the dataset** The correlation plot of the dependent-variables from the dataset is shown below. .. GENERATED FROM PYTHON SOURCE LINES 45-56 .. code-block:: Python import matplotlib.pyplot as plt y0 = zero_d_dataset.dependent_variables[0] y1 = zero_d_dataset.dependent_variables[1] plt.scatter(y1.components[0], y0.components[0], s=2, c="k") plt.xlabel(y1.axis_label[0]) plt.ylabel(y0.axis_label[0]) plt.tight_layout() plt.show() .. image-sg:: /auto_examples/correlated_examples/images/sphx_glr_plot_0_0D11_dataset_001.png :alt: plot 0 0D11 dataset :srcset: /auto_examples/correlated_examples/images/sphx_glr_plot_0_0D11_dataset_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 57-62 .. rubric:: Citation .. [#f3] Srivastava DJ, Florian P, Baltisberger JH, Grandinetti PJ. Correlating geminal couplings to structure in framework silicates. Phys Chem Chem Phys. 2018;20:562–571. DOI:10.1039/C7CP06486A .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.269 seconds) .. _sphx_glr_download_auto_examples_correlated_examples_plot_0_0D11_dataset.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_0_0D11_dataset.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_0_0D11_dataset.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_