.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/basic/plot_mode_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_gallery_basic_plot_mode_field.py: Mode fields =========== .. GENERATED FROM PYTHON SOURCE LINES 8-10 Imports ~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 10-15 .. code-block:: Python from PyFiberModes import HE11, LP01, LP11 from PyFiberModes.field import Field from PyFiberModes.fiber import load_fiber import matplotlib.pyplot as plt .. GENERATED FROM PYTHON SOURCE LINES 16-19 Generating the fiber structures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here we create the different fiber design that we want to explore .. GENERATED FROM PYTHON SOURCE LINES 19-21 .. code-block:: Python fiber = load_fiber('SMF28', wavelength=1310e-9) .. GENERATED FROM PYTHON SOURCE LINES 22-23 Preparing the figure .. GENERATED FROM PYTHON SOURCE LINES 23-48 .. code-block:: Python figure, ax = plt.subplots(1, 1) ax.set( title='Mode fields for vectorial mode if x-direction', xlabel='Radius', ylabel='Amplitude' ) for mode in [HE11, LP01, LP11]: field = Field( fiber=fiber, mode=mode, limit=10e-6, n_point=101 ) Ex = field.Ex() max_abs = abs(max(Ex.max(), Ex.min())) ax.pcolormesh(Ex, vmin=-max_abs, vmax=max_abs) plt.show() # - .. image-sg:: /gallery/basic/images/sphx_glr_plot_mode_field_001.png :alt: Mode fields for vectorial mode if x-direction :srcset: /gallery/basic/images/sphx_glr_plot_mode_field_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 8.484 seconds) .. _sphx_glr_download_gallery_basic_plot_mode_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_mode_field.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_mode_field.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_