{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# The mplot3d Toolkit\n\n\nGenerating 3D plots using the mplot3d toolkit.\n\n.. currentmodule:: mpl_toolkits.mplot3d\n :backlinks: none\n\n\nGetting started\n---------------\nAn Axes3D object is created just like any other axes using\nthe projection='3d' keyword.\nCreate a new :class:`matplotlib.figure.Figure` and\nadd a new axes to it of type :class:`~mpl_toolkits.mplot3d.Axes3D`::\n\n import matplotlib.pyplot as plt\n from mpl_toolkits.mplot3d import Axes3D\n fig = plt.figure()\n ax = fig.add_subplot(111, projection='3d')\n\n.. versionadded:: 1.0.0\n This approach is the preferred method of creating a 3D axes.\n\n
Prior to version 1.0.0, the method of creating a 3D axes was\n different. For those using older versions of matplotlib, change\n ``ax = fig.add_subplot(111, projection='3d')``\n to ``ax = Axes3D(fig)``.