def METHOD_NAME(
    self, val: Optional[Union[Tensor, Sequence[Tensor]]] = None, ax: Optional[_AX_TYPE] = None
) -> _PLOT_OUT_TYPE:
    """Plot a single or multiple values from the metric.
    Args:
        val: Either a single result from calling `metric.forward` or `metric.compute` or a list of these results.
            If no value is provided, will automatically call `metric.compute` and plot that result.
        ax: An matplotlib axis object. If provided will add plot to that axis
    Returns:
        Figure object and Axes object
    Raises:
        ModuleNotFoundError:
            If `matplotlib` is not installed
    .. plot::
        :scale: 75
        >>> # Example plotting single value
        >>> import torch
        >>> from torchmetrics.detection import GeneralizedIntersectionOverUnion
        >>> preds = [
        ...    {
        ...        "boxes": torch.tensor([[296.55, 93.96, 314.97, 152.79], [298.55, 98.96, 314.97, 151.79]]),
        ...        "scores": torch.tensor([0.236, 0.56]),
        ...        "labels": torch.tensor([4, 5]),
        ...    }
        ... ]
        >>> target = [
        ...    {
        ...        "boxes": torch.tensor([[300.00, 100.00, 315.00, 150.00]]),
        ...        "labels": torch.tensor([5]),
        ...    }
        ... ]
        >>> metric = GeneralizedIntersectionOverUnion()
        >>> metric.update(preds, target)
        >>> fig_, ax_ = metric.plot()
    .. plot::
        :scale: 75
        >>> # Example plotting multiple values
        >>> import torch
        >>> from torchmetrics.detection import GeneralizedIntersectionOverUnion
        >>> preds = [
        ...    {
        ...        "boxes": torch.tensor([[296.55, 93.96, 314.97, 152.79], [298.55, 98.96, 314.97, 151.79]]),
        ...        "scores": torch.tensor([0.236, 0.56]),
        ...        "labels": torch.tensor([4, 5]),
        ...    }
        ... ]
        >>> target = lambda : [
        ...    {
        ...        "boxes": torch.tensor([[300.00, 100.00, 335.00, 150.00]]) + torch.randint(-10, 10, (1, 4)),
        ...        "labels": torch.tensor([5]),
        ...    }
        ... ]
        >>> metric = GeneralizedIntersectionOverUnion()
        >>> vals = []
        >>> for _ in range(20):
        ...     vals.append(metric(preds, target()))
        >>> fig_, ax_ = metric.plot(vals)
    """
    return self._plot(val, ax)