pitchscapes.plotting.scape_plot_from_array

pitchscapes.plotting.scape_plot_from_array(arr, ax=None, times=None, check=True, coord_kwargs=None, plot_kwargs=None)[source]

Generate a scape plot from a numpy array of values or colours. :type arr: ndarray :param arr: array of values or colors; must be of shape (L,), (L, 3), or (L, 4), where L = n*(n+1)/2 for some integer n; for the two dimensional versions the second dimension is interpreted as RGB or RGBA values, respectively. :type ax: :param ax: [optional] axis to plot to :type times: :param times: optional array of length n + 1 with boundaries between the time slots; if not provided n uniformly spaced slots of width 1/n in [0, 1] are assumed. :type check: :param check: [default=True] check dimensions of arr and times. :type coord_kwargs: :param coord_kwargs: optional kwargs passed to coords_from_times function. :type plot_kwargs: :param plot_kwargs: optional kwargs passed to scape_plot function.