DOC Fix axes3d matplotlib deprecation warning
@@ -16,7 +16,6 @@ information on this dataset.
import numpy as np
import matplotlib.pyplot as plt
-from mpl_toolkits.mplot3d import Axes3D
from sklearn import decomposition
@@ -30,7 +29,10 @@ y = iris.target
fig = plt.figure(1, figsize=(4, 3))
plt.clf()
-ax = Axes3D(fig, rect=[0, 0, 0.95, 1], elev=48, azim=134)
+
+ax = fig.add_subplot(111, projection="3d", elev=48, azim=134)
+ax.set_position([0, 0, 0.95, 1])
+
plt.cla()
pca = decomposition.PCA(n_components=3)
