()
| 2001 | |
| 2002 | @image_comparison(['rgba_clean_edges.png'], style='_classic_test', tol=0.003) |
| 2003 | def test_rgba_clean_edges(): |
| 2004 | np.random.seed(19680801+9) # same as in test_upsampling() |
| 2005 | data = np.random.rand(8, 8) |
| 2006 | data = np.stack([data, data]) |
| 2007 | data[1, 2:4, 2:4] = np.nan |
| 2008 | |
| 2009 | rotation = Affine2D().rotate_around(3.5, 3.5, 1) |
| 2010 | |
| 2011 | fig, axs = plt.subplots(1, 2) |
| 2012 | |
| 2013 | for i in range(2): |
| 2014 | # Add background patches to check the fading to non-white colors |
| 2015 | black = Rectangle((3.75, 2), 5, 5, color='black', zorder=0) |
| 2016 | gray = Rectangle((0, -2), 3.75, 4, color='gray', zorder=0) |
| 2017 | partly_black = Rectangle((3.75, -2), 5, 4, fc='black', ec='none', |
| 2018 | alpha=0.5, zorder=0) |
| 2019 | axs[i].add_patch(black) |
| 2020 | axs[i].add_patch(gray) |
| 2021 | axs[i].add_patch(partly_black) |
| 2022 | |
| 2023 | axs[i].imshow(data[i, ...], |
| 2024 | interpolation='bilinear', interpolation_stage='rgba', |
| 2025 | transform=rotation + axs[i].transData) |
| 2026 | |
| 2027 | axs[i].set_axis_off() |
| 2028 | axs[i].set_xlim(-2.5, 9.5) |
| 2029 | axs[i].set_ylim(-2.5, 9.5) |
| 2030 | |
| 2031 | |
| 2032 | @image_comparison(['affine_fill_to_edges.png'], style='_classic_test') |
nothing calls this directly
no test coverage detected
searching dependent graphs…