{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Marker examples\n\nDemonstrates several ways to specify markers in scatter plots,\nincluding built-in marker styles and custom marker paths.\n\nSee also the `matplotlib.markers` documentation for a list of all markers and\n:doc:`/gallery/lines_bars_and_markers/marker_reference` for more information\non configuring markers.\n\n.. redirect-from:: /gallery/lines_bars_and_markers/scatter_custom_symbol\n.. redirect-from:: /gallery/lines_bars_and_markers/scatter_symbol\n.. redirect-from:: /gallery/lines_bars_and_markers/scatter_piecharts\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\nimport numpy as np\n\n# Fixing random state for reproducibility\nnp.random.seed(19680801)\n\nx = np.random.rand(10)\ny = np.random.rand(10)\nz = np.sqrt(x**2 + y**2)\n\nfig, axs = plt.subplots(2, 3, sharex=True, sharey=True, layout=\"constrained\")\n\n# Matplotlib marker symbol\naxs[0, 0].scatter(x, y, s=80, c=z, marker=\">\")\naxs[0, 0].set_title(\"marker='>'\")\n\n# marker from TeX: passing a TeX symbol name enclosed in $-signs\naxs[0, 1].scatter(x, y, s=80, c=z, marker=r\"$\\clubsuit$\")\naxs[0, 1].set_title(r\"marker=r'\\$\\clubsuit\\$'\")\n\n# marker from path: passing a custom path of N vertices as a (N, 2) array-like\nverts = [[-1, -1], [1, -1], [1, 1], [-1, -1]]\naxs[0, 2].scatter(x, y, s=80, c=z, marker=verts)\naxs[0, 2].set_title(\"marker=verts\")\n\n# regular pentagon marker\naxs[1, 0].scatter(x, y, s=80, c=z, marker=(5, 0))\naxs[1, 0].set_title(\"marker=(5, 0)\")\n\n# regular 5-pointed star marker\naxs[1, 1].scatter(x, y, s=80, c=z, marker=(5, 1))\naxs[1, 1].set_title(\"marker=(5, 1)\")\n\n# regular 5-pointed asterisk marker\naxs[1, 2].scatter(x, y, s=80, c=z, marker=(5, 2))\naxs[1, 2].set_title(\"marker=(5, 2)\")\n\nplt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        ".. tags::\n\n   component: marker\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
}