MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_grayscale_alpha

Function test_grayscale_alpha

lib/matplotlib/tests/test_backend_pdf.py:313–321  ·  view source on GitHub ↗

Masking images with NaN did not work for grayscale images

()

Source from the content-addressed store, hash-verified

311
312@image_comparison(['grayscale_alpha.pdf'], style='_classic_test')
313def test_grayscale_alpha():
314 """Masking images with NaN did not work for grayscale images"""
315 x, y = np.ogrid[-2:2:.1, -2:2:.1]
316 dd = np.exp(-(x**2 + y**2))
317 dd[dd < .1] = np.nan
318 fig, ax = plt.subplots()
319 ax.imshow(dd, interpolation='none', cmap='gray_r')
320 ax.set_xticks([])
321 ax.set_yticks([])
322
323
324@mpl.style.context('default')

Callers

nothing calls this directly

Calls 4

imshowMethod · 0.80
set_xticksMethod · 0.80
set_yticksMethod · 0.80
subplotsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…