from torch import rand, randint
from torchmetrics.classification import MulticlassRecallAtFixedPrecision
metric = MulticlassRecallAtFixedPrecision(num_classes=3, min_precision=0.5)
values = []
for _ in range(20):
    # we index by 0 such that only the maximum recall value is plotted
    values.append(metric(rand(20, 3).softmax(dim=-1), randint(3, (20,)))[0])
fig_, ax_ = metric.plot(values)
