.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/00_misc/05_standalone_field.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_examples_00_misc_05_standalone_field.py: Standalone Field class ---------------------- The :any:`Field` class of GSTools can be used to plot arbitrary data in nD. In the following example we will produce 10000 random points in 4D with random values and plot them. .. GENERATED FROM PYTHON SOURCE LINES 10-22 .. code-block:: Python import numpy as np import gstools as gs rng = np.random.RandomState(19970221) x0 = rng.rand(10000) * 100.0 x1 = rng.rand(10000) * 100.0 x2 = rng.rand(10000) * 100.0 x3 = rng.rand(10000) * 100.0 values = rng.rand(10000) * 100.0 .. GENERATED FROM PYTHON SOURCE LINES 23-27 Only thing needed to instantiate the Field is the dimension. Afterwards we can call the instance like all other Fields (:any:`SRF`, :any:`Krige` or :any:`CondSRF`), but with an additional field. .. GENERATED FROM PYTHON SOURCE LINES 27-31 .. code-block:: Python plotter = gs.field.Field(dim=4) plotter(pos=(x0, x1, x2, x3), field=values) plotter.plot() .. image-sg:: /examples/00_misc/images/sphx_glr_05_standalone_field_001.png :alt: Field 4D unstructured (10000,), Plane :srcset: /examples/00_misc/images/sphx_glr_05_standalone_field_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.344 seconds) .. _sphx_glr_download_examples_00_misc_05_standalone_field.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 05_standalone_field.ipynb <05_standalone_field.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 05_standalone_field.py <05_standalone_field.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 05_standalone_field.zip <05_standalone_field.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_