.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "intro/matplotlib/auto_examples/plot_plot3d-2.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_intro_matplotlib_auto_examples_plot_plot3d-2.py: 3D plotting ============ Demo 3D plotting with matplotlib and style the figure. .. GENERATED FROM PYTHON SOURCE LINES 7-37 .. image-sg:: /intro/matplotlib/auto_examples/images/sphx_glr_plot_plot3d-2_001.png :alt: plot plot3d 2 :srcset: /intro/matplotlib/auto_examples/images/sphx_glr_plot_plot3d-2_001.png :class: sphx-glr-single-img .. code-block:: default import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import axes3d ax = plt.figure().add_subplot(projection='3d') X, Y, Z = axes3d.get_test_data(0.05) cset = ax.contourf(X, Y, Z) ax.clabel(cset, fontsize=9, inline=1) plt.xticks([]) plt.yticks([]) ax.set_zticks([]) ax.text2D(-0.05, 1.05, " 3D plots \n", horizontalalignment='left', verticalalignment='top', bbox=dict(facecolor='white', alpha=1.0), family='DejaVu Sans', size='x-large', transform=plt.gca().transAxes) ax.text2D(-0.05, .975, " Plot 2D or 3D data", horizontalalignment='left', verticalalignment='top', family='DejaVu Sans', size='medium', transform=plt.gca().transAxes) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.045 seconds) .. _sphx_glr_download_intro_matplotlib_auto_examples_plot_plot3d-2.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_plot3d-2.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_plot3d-2.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_