(self)
| 1848 | return c[0], c[1], c[2] |
| 1849 | |
| 1850 | def test_colors(self) -> None: |
| 1851 | # with single color, we don't want rgb array |
| 1852 | artist = self.plotmethod(colors="k") |
| 1853 | assert artist.cmap.colors[0] == "k" |
| 1854 | |
| 1855 | # 2 colors, will repeat every other tick: |
| 1856 | artist = self.plotmethod(colors=["k", "b"]) |
| 1857 | assert artist.cmap.colors[:2] == ["k", "b"] |
| 1858 | |
| 1859 | # 4 colors, will repeat every 4th tick: |
| 1860 | artist = self.darray.plot.contour( |
| 1861 | levels=[-0.5, 0.0, 0.5, 1.0], colors=["k", "r", "w", "b"] |
| 1862 | ) |
| 1863 | assert artist.cmap.colors[:5] == ["k", "r", "w", "b"] # type: ignore[attr-defined,unused-ignore] |
| 1864 | |
| 1865 | # the last color is now under "over" |
| 1866 | assert self._color_as_tuple(artist.cmap.get_over()) == (0.0, 0.0, 1.0) |
| 1867 | |
| 1868 | def test_colors_np_levels(self) -> None: |
| 1869 | # https://github.com/pydata/xarray/issues/3284 |
nothing calls this directly
no test coverage detected