evutils.vis.plot3d#

Functions#

plot_3d(→ tuple)

Plot a 3D scatter plot of events.

plot_3d_histogram(→ tuple)

Plot a 3D histogram of events.

plot_3d_timesurface(→ tuple)

Module Contents#

evutils.vis.plot3d.plot_3d(events: numpy.ndarray, width: int = 1280, height: int = 720, colormap: str | matplotlib.colors.Colormap = 'Spectral', fig: matplotlib.pyplot.Figure | None = None, ax: mpl_toolkits.mplot3d.Axes3D | None = None) tuple[source]#

Plot a 3D scatter plot of events.

Parameters:
  • events (np.ndarray) – Array of events with fields ‘t’, ‘x’, ‘y’, and ‘p’.

  • width (int, optional) – Width of the event frame, by default 1280.

  • height (int, optional) – Height of the event frame, by default 720.

  • colormap (Union[str, Colormap], optional) – Colormap to use for the event polarities, by default ‘Spectral’.

  • fig (Optional[plt.Figure], optional) – Matplotlib figure to plot on, by default None (a new figure will be created).

  • ax (Optional[Axes3D], optional) – Matplotlib 3D axis to plot on, by default None (a new axis will be created).

Returns:

A tuple containing the figure and axis objects.

Return type:

tuple

Raises:

ValueError – If the colormap is not found or invalid.

evutils.vis.plot3d.plot_3d_histogram(histogram: numpy.ndarray, down_sample: int = 4, fig: matplotlib.pyplot.Figure | None = None, ax: mpl_toolkits.mplot3d.Axes3D | None = None) tuple[source]#

Plot a 3D histogram of events. :param histogram: 3D histogram array with shape (depth, height, width). :type histogram: np.ndarray :param down_sample: Downsampling factor for the histogram, by default 4. :type down_sample: int, optional :param fig: Matplotlib figure to plot on, by default None (a new figure will be created). :type fig: Optional[plt.Figure], optional :param ax: Matplotlib 3D axis to plot on, by default None (a new axis will be created). :type ax: Optional[Axes3D], optional

Returns:

A tuple containing the figure and axis objects.

Return type:

tuple

Parameters:
  • histogram (numpy.ndarray)

  • down_sample (int)

  • fig (Optional[matplotlib.pyplot.Figure])

  • ax (Optional[mpl_toolkits.mplot3d.Axes3D])

evutils.vis.plot3d.plot_3d_timesurface(events: numpy.ndarray, width: int = 1280, height: int = 720, tau: int = 10000, fig: matplotlib.pyplot.Figure | None = None, ax: mpl_toolkits.mplot3d.Axes3D | None = None) tuple[source]#
Parameters:
  • events (numpy.ndarray)

  • width (int)

  • height (int)

  • tau (int)

  • fig (Optional[matplotlib.pyplot.Figure])

  • ax (Optional[mpl_toolkits.mplot3d.Axes3D])

Return type:

tuple