.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples_gallery/fields/plot_cylindrical_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_gallery_fields_plot_cylindrical_field.py: Plotting a scalar field in cylindrical coordinates ================================================== This example shows how to initialize and visualize the scalar field :math:`u = \sqrt{z} \, \exp(-r^2)` in cylindrical coordinates. .. GENERATED FROM PYTHON SOURCE LINES 8-14 .. image-sg:: /examples_gallery/fields/images/sphx_glr_plot_cylindrical_field_001.png :alt: Scalar field in cylindrical coordinates :srcset: /examples_gallery/fields/images/sphx_glr_plot_cylindrical_field_001.png :class: sphx-glr-single-img .. code-block:: Python from pde import CylindricalSymGrid, ScalarField grid = CylindricalSymGrid(radius=3, bounds_z=[0, 4], shape=16) field = ScalarField.from_expression(grid, "sqrt(z) * exp(-r**2)") field.plot(title="Scalar field in cylindrical coordinates") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.197 seconds) .. _sphx_glr_download_examples_gallery_fields_plot_cylindrical_field.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_cylindrical_field.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_cylindrical_field.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_cylindrical_field.zip `