Skip to content

Commit 8ad8593

Browse files
authored
DOC remove deprecation warnings plot_mahalanobis_distances example (scikit-learn#27444)
1 parent d38a7e3 commit 8ad8593

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/covariance/plot_mahalanobis_distances.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
# MCD based Mahalanobis distances fit the inlier black points much better,
123123
# whereas the MLE based distances are more influenced by the outlier
124124
# red points.
125+
import matplotlib.lines as mlines
125126

126127
fig, ax = plt.subplots(figsize=(10, 5))
127128
# Plot data set
@@ -154,8 +155,8 @@
154155
# Add legend
155156
ax.legend(
156157
[
157-
emp_cov_contour.collections[1],
158-
robust_contour.collections[1],
158+
mlines.Line2D([], [], color="tab:blue", linestyle="dashed"),
159+
mlines.Line2D([], [], color="tab:orange", linestyle="dotted"),
159160
inlier_plot,
160161
outlier_plot,
161162
],

0 commit comments

Comments
 (0)