def test_plot_grid_text_color(self, color): s = load(KIKUCHIPY_FILE) vbse_gen = VirtualBSEGenerator(s) p = vbse_gen.plot_grid(color=color) assert p.metadata.Markers["text"].marker._color == color close("all")
def test_plot_grid(self, grid_shape, desired_n_markers): s = load(KIKUCHIPY_FILE) vbse_gen = VirtualBSEGenerator(s) vbse_gen.grid_shape = grid_shape rgb_channels = [(0, 0), (0, 1), (1, 0)] pattern_idx = (2, 2) p = vbse_gen.plot_grid(pattern_idx=pattern_idx, rgb_channels=rgb_channels) p2 = vbse_gen.plot_grid() # Check data type and values assert isinstance(p, EBSD) assert np.allclose(p.data, s.inav[pattern_idx].data) assert np.allclose(p2.data, s.inav[0, 0].data) # Check markers assert len(p.metadata.Markers) == desired_n_markers assert p.metadata.Markers.has_item("text") assert p.metadata.Markers["text"].marker._color == "r" assert p.metadata.Markers["horizontal_line"].marker._color == "w" assert p.metadata.Markers["rectangle"].marker._edgecolor == (1, 0, 0, 1) close("all")