Skip to main content

plots.plot_probe_rect2

plots.plot_probe_rect2(xy, color, ax, width=16, height=40, colorbar=False)

Plot probe channels using imshow for better visualization.

This function uses matplotlib’s imshow to visualize probe channels as colored rectangles, providing better performance and visualization quality compared to individual rectangle patches.

Args: xy (np.ndarray): Array of shape (n_channels, 2) containing x,y coordinates for each channel in micrometers. color (np.ndarray): Array of shape (n_channels, 3) or (n_channels, 4) containing RGB or RGBA colors for each channel. ax (matplotlib.axes.Axes): Axes on which to plot the visualization. width (float, optional): Width of each channel representation in micrometers. Defaults to 16. height (float, optional): Height of each channel representation in micrometers. Defaults to 40. colorbar (bool, optional): Whether to add a colorbar to the plot. Defaults to False.

Returns: None: The function modifies the provided axes.

Note: The function stretches the probe in the X direction (factor of 3) to improve readability for very long thin probes. It creates a rasterized representation using numpy arrays and imshow for efficient rendering.