farry

led-fade-curves

Aug 27th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. import matplotlib.pyplot as plt
  4.  
  5. def cie1931(L):
  6.     L = L*100.0
  7.     if L <= 8:
  8.         return (L/902.3)
  9.     else:
  10.         return ((L+16.0)/116.0)**3
  11.  
  12. x = [ w / 100 for w in range(-100, 100) ]
  13. cie = [ cie1931(abs(h)) for h in  x]
  14. x2 = [ h**2 for h in x ]
  15.  
  16. fig, ax = plt.subplots()
  17. ax.plot(x, cie, lw=2, label="cie1931")
  18. ax.plot(x, x2, lw=2, label = "squared")
  19. plt.legend(loc=0)
  20. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment