8000 Merge pull request #23532 from oscargus/test_rgb_axes · matplotlib/matplotlib@ca4af53 · GitHub
[go: up one dir, main page]

Skip to content

Commit ca4af53

Browse files
authored
Merge pull request #23532 from oscargus/test_rgb_axes
TST: Add test for RGBAxes
2 parents b45025d + fda5869 commit ca4af53

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Loading

lib/mpl_toolkits/tests/test_axes_grid1.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
AnchoredSizeBar, AnchoredDirectionArrows)
1919
from mpl_toolkits.axes_grid1.axes_divider import (
2020
HBoxDivider, make_axes_area_auto_adjustable)
21+
from mpl_toolkits.axes_grid1.axes_rgb import RGBAxes
2122
from mpl_toolkits.axes_grid1.inset_locator import (
2223
zoomed_inset_axes, mark_inset, inset_axes, BboxConnectorPatch)
2324
import mpl_toolkits.axes_grid1.mpl_axes
@@ -536,3 +537,14 @@ def test_auto_adjustable():
536537
assert tbb.x1 == pytest.approx(fig.bbox.width - pad * fig.dpi)
537538
assert tbb.y0 == pytest.approx(pad * fig.dpi)
538539
assert tbb.y1 == pytest.approx(fig.bbox.height - pad * fig.dpi)
540+
541+
542+
@image_comparison(['rgb_axes.png'], remove_text=True)
543+
def test_rgb_axes():
544+
fig = plt.figure()
545+
ax = RGBAxes(fig, (0.1, 0.1, 0.8, 0.8), pad=0.1)
546+
rng = np.random.default_rng(19680801)
547+
r = rng.random((5, 5))
548+
g = rng.random((5, 5))
549+
b = rng.random((5, 5))
550+
ax.imshow_rgb(r, g, b, interpolation='none')

0 commit comments

Comments
 (0)
0