.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/specialty_fibers/plot_specialty_mode_indices.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_specialty_fibers_plot_specialty_mode_indices.py: Specialty-fiber mode indices ============================ Compare the effective indices of low-order modes in a multilayer fiber. .. GENERATED FROM PYTHON SOURCE LINES 7-27 .. image-sg:: /gallery/specialty_fibers/images/sphx_glr_plot_specialty_mode_indices_001.png :alt: Low-order modes of DCF1300S-20 :srcset: /gallery/specialty_fibers/images/sphx_glr_plot_specialty_mode_indices_001.png :class: sphx-glr-single-img .. code-block:: Python from PyFiberModes.units import ureg import matplotlib.pyplot as plt from PyFiberModes import LP01, LP11, LP21 from PyFiberModes.fiber import load_fiber fiber = load_fiber("DCF1300S_20", wavelength=1550e-9 * ureg.meter) modes = (LP01, LP11, LP21) 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="Mode", ylabel="Effective index", title="Low-order modes of DCF1300S-20", ) axis.ticklabel_format(axis="y", useOffset=False) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.761 seconds) .. _sphx_glr_download_gallery_specialty_fibers_plot_specialty_mode_indices.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_specialty_mode_indices.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_specialty_mode_indices.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_specialty_mode_indices.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_