.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/analysis/plot_guided_mode_discovery.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_analysis_plot_guided_mode_discovery.py: Guided-mode discovery ===================== Discover the supported linearly polarized modes and compare their effective indices at one wavelength. .. GENERATED FROM PYTHON SOURCE LINES 8-24 .. image-sg:: /gallery/analysis/images/sphx_glr_plot_guided_mode_discovery_001.png :alt: SMF-28 at 1310 nm :srcset: /gallery/analysis/images/sphx_glr_plot_guided_mode_discovery_001.png :class: sphx-glr-single-img .. code-block:: Python from PyFiberModes.units import ureg import matplotlib.pyplot as plt from PyFiberModes.analysis import find_modes from PyFiberModes.fiber import load_fiber fiber = load_fiber("SMF28", wavelength=1310e-9 * ureg.meter) modes = find_modes(fiber, families=("LP",), max_nu=3, max_m=3) effective_indices = [fiber.get_effective_index(mode) for mode in modes] figure, axis = plt.subplots() axis.bar([str(mode) for mode in modes], effective_indices) axis.set(xlabel="Guided mode", ylabel="Effective index", title="SMF-28 at 1310 nm") axis.ticklabel_format(axis="y", useOffset=False) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.059 seconds) .. _sphx_glr_download_gallery_analysis_plot_guided_mode_discovery.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_guided_mode_discovery.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_guided_mode_discovery.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_guided_mode_discovery.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_