.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/fields/plot_vector_components.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_fields_plot_vector_components.py: Vector field components ======================= Evaluate several components together so they share one radial solver pass. .. GENERATED FROM PYTHON SOURCE LINES 7-26 .. image-sg:: /gallery/fields/images/sphx_glr_plot_vector_components_001.png :alt: Ex, Ey, Ez :srcset: /gallery/fields/images/sphx_glr_plot_vector_components_001.png :class: sphx-glr-single-img .. code-block:: Python from PyFiberModes.units import ureg import matplotlib.pyplot as plt from PyFiberModes import HE11 from PyFiberModes.fiber import load_fiber fiber = load_fiber("SMF28", wavelength=1550e-9 * ureg.meter) field = fiber.get_mode_field(HE11, limit=12e-6 * ureg.meter, n_point=151) components = field.get_components(("Ex", "Ey", "Ez")) figure, axes = plt.subplots(1, 3, figsize=(10, 3), constrained_layout=True) for axis, (name, values) in zip(axes, components.items()): image = axis.imshow(values.to("volt / meter").magnitude.real, origin="lower", cmap="RdBu_r") axis.set_title(name) axis.set_axis_off() figure.colorbar(image, ax=axis, shrink=0.75) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.466 seconds) .. _sphx_glr_download_gallery_fields_plot_vector_components.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_vector_components.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_vector_components.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_vector_components.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_