{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Clip the data to the axes view limits\n\nDemonstrate clipping of line and marker data to the axes view limits. The\n``axlim_clip`` keyword argument can be used in any of the 3D plotting\nfunctions.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\nimport numpy as np\n\nfig, ax = plt.subplots(subplot_kw={\"projection\": \"3d\"})\n\n# Make the data\nx = np.arange(-5, 5, 0.5)\ny = np.arange(-5, 5, 0.5)\nX, Y = np.meshgrid(x, y)\nR = np.sqrt(X**2 + Y**2)\nZ = np.sin(R)\n\n# Default behavior is axlim_clip=False\nax.plot_wireframe(X, Y, Z, color='C0')\n\n# When axlim_clip=True, note that when a line segment has one vertex outside\n# the view limits, the entire line is hidden. The same is true for 3D patches\n# if one of their vertices is outside the limits (not shown).\nax.plot_wireframe(X, Y, Z, color='C1', axlim_clip=True)\n\n# In this example, data where x < 0 or z > 0.5 is clipped\nax.set(xlim=(0, 10), ylim=(-5, 5), zlim=(-1, 0.5))\nax.legend(['axlim_clip=False (default)', 'axlim_clip=True'])\n\nplt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        ".. tags::\n   plot-type: 3D,\n   level: beginner\n\n"
      ]
    }
  ],
  "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.14.6"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}