{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# fill_between(x1, y1, z1, x2, y2, z2)\n\nSee `~mpl_toolkits.mplot3d.axes3d.Axes3D.fill_between`.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\nimport numpy as np\n\nplt.style.use('_mpl-gallery')\n\n# Make data for a double helix\nn = 50\ntheta = np.linspace(0, 2*np.pi, n)\nx1 = np.cos(theta)\ny1 = np.sin(theta)\nz1 = np.linspace(0, 1, n)\nx2 = np.cos(theta + np.pi)\ny2 = np.sin(theta + np.pi)\nz2 = z1\n\n# Plot\nfig, ax = plt.subplots(subplot_kw={\"projection\": \"3d\"})\nax.fill_between(x1, y1, z1, x2, y2, z2, alpha=0.5)\nax.plot(x1, y1, z1, linewidth=2, color='C0')\nax.plot(x2, y2, z2, linewidth=2, color='C0')\n\nax.set(xticklabels=[],\n yticklabels=[],\n zticklabels=[])\n\nplt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.5" } }, "nbformat": 4, "nbformat_minor": 0 }