Skip to content

Commit

Permalink
Standard colors
Browse files Browse the repository at this point in the history
  • Loading branch information
andykee committed Mar 17, 2024
1 parent cad2faa commit 98f73ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/examples/broadband.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Broadband diffraction simulation
psf += w2.intensity

fig, ax = plt.subplots()
ax.imshow(psf, norm='log')
ax.imshow(psf, norm='log', cmap='inferno')
ax.axis('off')
15 changes: 11 additions & 4 deletions docs/examples/simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Simple diffraction simulation
:include-source:
:scale: 50

import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import lentil
Expand All @@ -18,9 +19,15 @@ Simple diffraction simulation
opd = lentil.zernike_compose(mask=amp, coeffs=coef)

fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(5, 3))
ax1.imshow(amp)
ax1.imshow(amp, cmap='gray')
ax1.set_title('Amplitude')
ax2.imshow(opd)

# set up the OPD colormap to display NaNs as light gray
opd_plot = opd.copy()
opd_plot[np.where(opd_plot == 0)] = np.nan
opd_cmap = matplotlib.colormaps.get_cmap('RdBu_r')
opd_cmap.set_bad(color='#dddddd')
ax2.imshow(opd_plot, cmap=opd_cmap)
ax2.set_title('OPD')


Expand All @@ -44,7 +51,7 @@ Simple diffraction simulation

# plot the oversampled PSF
fig, ax = plt.subplots(figsize=(2.5, 2.5))
ax.imshow(w2.intensity)
ax.imshow(w2.intensity, cmap='inferno')


.. plot::
Expand All @@ -56,4 +63,4 @@ Simple diffraction simulation
# native sampling
img = lentil.detector.pixelate(w2.intensity, oversample=2)
fig, ax = plt.subplots(figsize=(2.5, 2.5))
ax.imshow(img)
ax.imshow(img, cmap='inferno')

0 comments on commit 98f73ea

Please sign in to comment.