In this recipe, we will learn how to plot a scatter plot in 3D. We will use the Iris dataset, which has three distinct clusters, for this example. We have seen it in 2D several times in previous chapters, so let's see how it looks in 3D.
We will also learn how to create an animated 3D plot using the init_view method that we learned in the preceding recipe. For this, we need to use any of the backends, since animation does not work with the inline display %matplotlib inline.