{ "nbformat_minor": 0, "nbformat": 4, "cells": [ { "execution_count": null, "cell_type": "code", "source": [ "%matplotlib inline" ], "outputs": [], "metadata": { "collapsed": false } }, { "source": [ "\n3D plotting\n============\n\nDemo 3D plotting with matplotlib and style the figure.\n\n" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "import matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import axes3d\n\nax = plt.gca(projection='3d')\nX, Y, Z = axes3d.get_test_data(0.05)\ncset = ax.contourf(X, Y, Z)\nax.clabel(cset, fontsize=9, inline=1)\n\nplt.xticks(())\nplt.yticks(())\nax.set_zticks(())\n\n\nax.text2D(-0.05, 1.05, \" 3D plots \\n\",\n horizontalalignment='left',\n verticalalignment='top',\n bbox=dict(facecolor='white', alpha=1.0),\n family='Lint McCree Intl BB',\n size='x-large',\n transform=plt.gca().transAxes)\n\nax.text2D(-0.05, .975, \" Plot 2D or 3D data\",\n horizontalalignment='left',\n verticalalignment='top',\n family='Lint McCree Intl BB',\n size='medium',\n transform=plt.gca().transAxes)\n\nplt.show()" ], "outputs": [], "metadata": { "collapsed": false } } ], "metadata": { "kernelspec": { "display_name": "Python 2", "name": "python2", "language": "python" }, "language_info": { "mimetype": "text/x-python", "nbconvert_exporter": "python", "name": "python", "file_extension": ".py", "version": "2.7.12", "pygments_lexer": "ipython2", "codemirror_mode": { "version": 2, "name": "ipython" } } } }