Skip to content

Commit

Permalink
Added example to colorsynth.color_matching_x()
Browse files Browse the repository at this point in the history
  • Loading branch information
byrdie committed Nov 2, 2023
1 parent 5b027ea commit 11164ff
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions colorsynth/_colorsynth.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ def color_matching_x(wavelength: u.Quantity) -> u.Quantity:
Parameters
----------
wavelength
the wavelengths at which to evaluate the color-matching function
Examples
--------
Plot :math:`\overline{x}(\lambda)` over the entire human visible wavelength range
.. jupyter-execute::
import numpy as np
import matplotlib.pyplot as plt
import astropy.units as u
import astropy.visualization
import colorsynth
wavelength = np.linspace(380, 780, num=101) * u.nm
xbar = colorsynth.color_matching_x(wavelength)
with astropy.visualization.quantity_support():
plt.figure()
plt.plot(wavelength, xbar)
"""
g = _piecewise_gaussian
term_1 = 1.056 * g(
Expand Down

0 comments on commit 11164ff

Please sign in to comment.