import matplotlib.pyplot as plt
from plotly import tools
fig, ax = plt.subplots()
ax.plot([0, 1], [0, 1], drawstyle="steps-post", label="foo")
ax.legend()
tools.mpl_to_plotly(fig)
from sklearn.metrics import PrecisionRecallDisplay
from plotly import tools
y_test = [1]
predicted_probabilities = [0.9]
display = PrecisionRecallDisplay.from_predictions(y_test, predicted_probabilities)
tools.mpl_to_plotly(display.figure_)