.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/specialty_fibers/plot_specialty_fiber_catalog.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_fiber_catalog.py: Specialty-fiber catalog ======================= Compare the layer indices of several bundled dispersion-compensating fibers. .. GENERATED FROM PYTHON SOURCE LINES 7-35 .. image-sg:: /gallery/specialty_fibers/images/sphx_glr_plot_specialty_fiber_catalog_001.png :alt: Bundled specialty-fiber designs :srcset: /gallery/specialty_fibers/images/sphx_glr_plot_specialty_fiber_catalog_001.png :class: sphx-glr-single-img .. code-block:: Python from PyFiberModes.units import ureg import matplotlib.pyplot as plt import numpy as np from PyFiberModes.fiber import load_fiber fiber_names = ("DCF1300S_20", "DCF1300S_26", "DCF1300S_33", "DCF1300S_42") fibers = [load_fiber(name, wavelength=1550e-9 * ureg.meter) for name in fiber_names] layer_indices = np.asarray( [[layer.refractive_index for layer in fiber.layers] for fiber in fibers] ) figure, axis = plt.subplots() positions = np.arange(len(fiber_names)) width = 0.24 for layer_number in range(layer_indices.shape[1]): axis.bar( positions + (layer_number - 1) * width, layer_indices[:, layer_number], width=width, label=f"Layer {layer_number + 1}", ) axis.set_xticks(positions, fiber_names, rotation=20) axis.set(ylabel="Refractive index", title="Bundled specialty-fiber designs") axis.ticklabel_format(axis="y", useOffset=False) axis.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.084 seconds) .. _sphx_glr_download_gallery_specialty_fibers_plot_specialty_fiber_catalog.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_fiber_catalog.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_specialty_fiber_catalog.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_specialty_fiber_catalog.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_