DOC remove MatplotlibDeprecationWarnings for plot_pca_iris example
@@ -21,6 +21,9 @@ import matplotlib.pyplot as plt
from sklearn import decomposition
from sklearn import datasets
+# unused but required import for doing 3d projections with matplotlib < 3.2
+import mpl_toolkits.mplot3d # noqa: F401
+
np.random.seed(5)
iris = datasets.load_iris()
@@ -52,8 +55,8 @@ for name, label in [("Setosa", 0), ("Versicolour", 1), ("Virginica", 2)]:
y = np.choose(y, [1, 2, 0]).astype(float)
ax.scatter(X[:, 0], X[:, 1], X[:, 2], c=y, cmap=plt.cm.nipy_spectral, edgecolor="k")
-ax.w_xaxis.set_ticklabels([])
-ax.w_yaxis.set_ticklabels([])
-ax.w_zaxis.set_ticklabels([])
+ax.xaxis.set_ticklabels([])
+ax.yaxis.set_ticklabels([])
+ax.zaxis.set_ticklabels([])
plt.show()
