.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_gallery/data/plot_coverage.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_auto_gallery_data_plot_coverage.py: Wavelength coverage of the curated data ======================================= One row per gas, one tick per curated value that bears on the linear dispersion, coloured by what it is: a source's own measurement, a calculation, or a value reproduced from a source outside the library. Static values (the polarizability at zero frequency) sit at the right edge. The gaps are where new data would help most. .. GENERATED FROM PYTHON SOURCE LINES 16-66 .. image-sg:: /auto_gallery/data/images/sphx_glr_plot_coverage_001.svg :alt: Curated dispersion data by gas and wavelength :srcset: /auto_gallery/data/images/sphx_glr_plot_coverage_001.svg :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from optmat.datasets import datasets, sources from optmat.gas.gases import Gas KINDS = { "measurement": ("#2a78d6", "measured"), "theory": ("#eb6834", "calculated"), "reproduced": ("#52514e", "reproduced from outside the library"), } edge = 18e-6 fig, ax = plt.subplots(figsize=(8, 5.5), layout="constrained") gases = list(Gas) offsets = {"measurement": -0.2, "theory": 0.0, "reproduced": 0.2} for row, gas in enumerate(gases): ticks = {key: [] for key in KINDS} for dataset in datasets(gas): if dataset.abscissa != "wavelength" or dataset.use in {"check", "excluded"}: continue wavelength = dataset.vacuum_wavelength() kind = sources()[dataset.source].kind key = "reproduced" if dataset.use == "reproduced" else kind ticks[key if key in KINDS else "measurement"].append( np.where(np.isinf(wavelength), edge, wavelength) ) for key, shown in ticks.items(): if not shown: continue # One tick per 1e-3 decade (a third of a pixel): the figure is unchanged, and # its SVG holds no tick drawn over another. position = np.unique(np.round(np.log10(np.concatenate(shown) * 1e9), 3)) ax.plot( 10**position, np.full(position.shape, row + offsets[key]), "|", color=KINDS[key][0], markersize=7, ) for colour, label in KINDS.values(): ax.plot([], [], "|", color=colour, markersize=9, label=label) ax.set_xscale("log") ax.set_xlim(40, edge * 1.1e9) ax.set_yticks(range(len(gases)), [g.value for g in gases]) ax.invert_yaxis() ax.set_xlabel("vacuum wavelength (nm); static values at the right edge") ax.grid(axis="x", which="both", alpha=0.25) ax.legend(loc="lower right", fontsize=8) ax.set_title("Curated dispersion data by gas and wavelength") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.587 seconds) .. _sphx_glr_download_auto_gallery_data_plot_coverage.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_coverage.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_coverage.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_coverage.zip `