initial upload
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Aliased versus anti-aliased\n\nThis example demonstrates aliased versus anti-aliased text.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import matplotlib.pyplot as plt\n\nsize = 128, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\n\nplt.axes((0, 0, 1, 1), frameon=False)\n\nplt.rcParams[\"text.antialiased\"] = False\nplt.text(0.5, 0.5, \"Aliased\", ha=\"center\", va=\"center\")\n\nplt.xlim(0, 1)\nplt.ylim(0, 1)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Alpha: transparency\n\nThis example demonstrates using alpha for transparency.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0.1, 1, 0.8), frameon=False)\n\nfor i in range(1, 11):\n plt.axvline(i, linewidth=1, color=\"blue\", alpha=0.25 + 0.75 * i / 10.0)\n\nplt.xlim(0, 11)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Aliased versus anti-aliased\n\nThe example shows aliased versus anti-aliased text.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import matplotlib.pyplot as plt\n\nsize = 128, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nplt.rcParams[\"text.antialiased\"] = True\nplt.text(0.5, 0.5, \"Anti-aliased\", ha=\"center\", va=\"center\")\n\nplt.xlim(0, 1)\nplt.ylim(0, 1)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# The colors matplotlib line plots\n\nAn example demoing the various colors taken by matplotlib's plot.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0.1, 1, 0.8), frameon=False)\n\nfor i in range(1, 11):\n plt.plot([i, i], [0, 1], lw=1.5)\n\nplt.xlim(0, 11)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Colormaps\n\nAn example plotting the matplotlib colormaps.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\n\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n\nplt.rc(\"text\", usetex=False)\na = np.outer(np.arange(0, 1, 0.01), np.ones(10))\n\nplt.figure(figsize=(10, 5))\nplt.subplots_adjust(top=0.8, bottom=0.05, left=0.01, right=0.99)\nmaps = [m for m in matplotlib.colormaps if not m.endswith(\"_r\")]\nmaps.sort()\nl = len(maps) + 1\n\nfor i, m in enumerate(maps):\n plt.subplot(1, l, i + 1)\n plt.axis(\"off\")\n plt.imshow(a, aspect=\"auto\", cmap=plt.get_cmap(m), origin=\"lower\")\n plt.title(m, rotation=90, fontsize=10, va=\"bottom\")\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Dash capstyle\n\nAn example demoing the dash capstyle.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\nimport matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nplt.plot(\n np.arange(4),\n np.ones(4),\n color=\"blue\",\n dashes=[15, 15],\n linewidth=8,\n dash_capstyle=\"butt\",\n)\n\nplt.plot(\n 5 + np.arange(4),\n np.ones(4),\n color=\"blue\",\n dashes=[15, 15],\n linewidth=8,\n dash_capstyle=\"round\",\n)\n\nplt.plot(\n 10 + np.arange(4),\n np.ones(4),\n color=\"blue\",\n dashes=[15, 15],\n linewidth=8,\n dash_capstyle=\"projecting\",\n)\n\nplt.xlim(0, 14)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Dash join style\n\nExample demoing the dash join style.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\nimport matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nplt.plot(\n np.arange(3),\n [0, 1, 0],\n color=\"blue\",\n dashes=[12, 5],\n linewidth=8,\n dash_joinstyle=\"miter\",\n)\nplt.plot(\n 4 + np.arange(3),\n [0, 1, 0],\n color=\"blue\",\n dashes=[12, 5],\n linewidth=8,\n dash_joinstyle=\"bevel\",\n)\nplt.plot(\n 8 + np.arange(3),\n [0, 1, 0],\n color=\"blue\",\n dashes=[12, 5],\n linewidth=8,\n dash_joinstyle=\"round\",\n)\n\nplt.xlim(0, 12)\nplt.ylim(-1, 2)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Linestyles\n\nPlot the different line styles.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef linestyle(ls, i):\n X = i * 0.5 * np.ones(11)\n Y = np.arange(11)\n plt.plot(\n X,\n Y,\n ls,\n color=(0.0, 0.0, 1, 1),\n lw=3,\n ms=8,\n mfc=(0.75, 0.75, 1, 1),\n mec=(0, 0, 1, 1),\n )\n plt.text(0.5 * i, 10.25, ls, rotation=90, fontsize=15, va=\"bottom\")\n\n\nlinestyles = [\n \"-\",\n \"--\",\n \":\",\n \"-.\",\n \".\",\n \",\",\n \"o\",\n \"^\",\n \"v\",\n \"<\",\n \">\",\n \"s\",\n \"+\",\n \"x\",\n \"d\",\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"h\",\n \"p\",\n \"|\",\n \"_\",\n \"D\",\n \"H\",\n]\nn_lines = len(linestyles)\n\nsize = 20 * n_lines, 300\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nplt.axes((0, 0.01, 1, 0.9), frameon=False)\n\nfor i, ls in enumerate(linestyles):\n linestyle(ls, i)\n\nplt.xlim(-0.2, 0.2 + 0.5 * n_lines)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Linewidth\n\nPlot various linewidth with matplotlib.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0.1, 1, 0.8), frameon=False)\n\nfor i in range(1, 11):\n plt.plot([i, i], [0, 1], color=\"b\", lw=i / 2.0)\n\nplt.xlim(0, 11)\nplt.ylim(0, 1)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Markers\n\nShow the different markers of matplotlib.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef marker(m, i):\n X = i * 0.5 * np.ones(11)\n Y = np.arange(11)\n\n plt.plot(X, Y, lw=1, marker=m, ms=10, mfc=(0.75, 0.75, 1, 1), mec=(0, 0, 1, 1))\n plt.text(0.5 * i, 10.25, repr(m), rotation=90, fontsize=15, va=\"bottom\")\n\n\nmarkers = [\n 0,\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n \"o\",\n \"h\",\n \"_\",\n \"1\",\n \"2\",\n \"3\",\n \"4\",\n \"8\",\n \"p\",\n \"^\",\n \"v\",\n \"<\",\n \">\",\n \"|\",\n \"d\",\n \",\",\n \"+\",\n \"s\",\n \"*\",\n \"|\",\n \"x\",\n \"D\",\n \"H\",\n \".\",\n]\n\nn_markers = len(markers)\n\nsize = 20 * n_markers, 300\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nplt.axes((0, 0.01, 1, 0.9), frameon=False)\n\nfor i, m in enumerate(markers):\n marker(m, i)\n\nplt.xlim(-0.2, 0.2 + 0.5 * n_markers)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Marker edge color\n\nDemo the marker edge color of matplotlib's markers.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\nimport matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nrng = np.random.default_rng()\n\nfor i in range(1, 11):\n r, g, b = np.random.uniform(0, 1, 3)\n plt.plot(\n [\n i,\n ],\n [\n 1,\n ],\n \"s\",\n markersize=5,\n markerfacecolor=\"w\",\n markeredgewidth=1.5,\n markeredgecolor=(r, g, b, 1),\n )\n\nplt.xlim(0, 11)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Marker edge width\n\nDemo the marker edge widths of matplotlib's markers.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nfor i in range(1, 11):\n plt.plot(\n [\n i,\n ],\n [\n 1,\n ],\n \"s\",\n markersize=5,\n markeredgewidth=1 + i / 10.0,\n markeredgecolor=\"k\",\n markerfacecolor=\"w\",\n )\nplt.xlim(0, 11)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Marker face color\n\nDemo the marker face color of matplotlib's markers.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\nimport matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nrng = np.random.default_rng()\n\nfor i in range(1, 11):\n r, g, b = np.random.uniform(0, 1, 3)\n plt.plot(\n [\n i,\n ],\n [\n 1,\n ],\n \"s\",\n markersize=8,\n markerfacecolor=(r, g, b, 1),\n markeredgewidth=0.1,\n markeredgecolor=(0, 0, 0, 0.5),\n )\nplt.xlim(0, 11)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Marker size\n\nDemo the marker size control in matplotlib.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nfor i in range(1, 11):\n plt.plot(\n [\n i,\n ],\n [\n 1,\n ],\n \"s\",\n markersize=i,\n markerfacecolor=\"w\",\n markeredgewidth=0.5,\n markeredgecolor=\"k\",\n )\n\nplt.xlim(0, 11)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Solid cap style\n\nAn example demoing the solide cap style in matplotlib.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\nimport matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nplt.plot(np.arange(4), np.ones(4), color=\"blue\", linewidth=8, solid_capstyle=\"butt\")\n\nplt.plot(\n 5 + np.arange(4), np.ones(4), color=\"blue\", linewidth=8, solid_capstyle=\"round\"\n)\n\nplt.plot(\n 10 + np.arange(4),\n np.ones(4),\n color=\"blue\",\n linewidth=8,\n solid_capstyle=\"projecting\",\n)\n\nplt.xlim(0, 14)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Solid joint style\n\nAn example showing the different solid joint styles in matplotlib.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\nimport matplotlib.pyplot as plt\n\nsize = 256, 16\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\nplt.axes((0, 0, 1, 1), frameon=False)\n\nplt.plot(np.arange(3), [0, 1, 0], color=\"blue\", linewidth=8, solid_joinstyle=\"miter\")\nplt.plot(\n 4 + np.arange(3), [0, 1, 0], color=\"blue\", linewidth=8, solid_joinstyle=\"bevel\"\n)\nplt.plot(\n 8 + np.arange(3), [0, 1, 0], color=\"blue\", linewidth=8, solid_joinstyle=\"round\"\n)\n\nplt.xlim(0, 12)\nplt.ylim(-1, 2)\nplt.xticks([])\nplt.yticks([])\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"\n# Locators for tick on axis\n\nAn example demoing different locators to position ticks on axis for\nmatplotlib.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\n\nfrom matplotlib import ticker\nimport matplotlib.pyplot as plt\n\n\ndef tickline():\n plt.xlim(0, 10), plt.ylim(-1, 1), plt.yticks([])\n ax = plt.gca()\n ax.spines[\"right\"].set_color(\"none\")\n ax.spines[\"left\"].set_color(\"none\")\n ax.spines[\"top\"].set_color(\"none\")\n ax.xaxis.set_ticks_position(\"bottom\")\n ax.spines[\"bottom\"].set_position((\"data\", 0))\n ax.yaxis.set_ticks_position(\"none\")\n ax.xaxis.set_minor_locator(ticker.MultipleLocator(0.1))\n ax.plot(np.arange(11), np.zeros(11))\n return ax\n\n\nlocators = [\n \"ticker.NullLocator()\",\n \"ticker.MultipleLocator(1.0)\",\n \"ticker.FixedLocator([0, 2, 8, 9, 10])\",\n \"ticker.IndexLocator(3, 1)\",\n \"ticker.LinearLocator(5)\",\n \"ticker.LogLocator(2, [1.0])\",\n \"ticker.AutoLocator()\",\n]\n\nn_locators = len(locators)\n\nsize = 512, 40 * n_locators\ndpi = 72.0\nfigsize = size[0] / float(dpi), size[1] / float(dpi)\nfig = plt.figure(figsize=figsize, dpi=dpi)\nfig.patch.set_alpha(0)\n\n\nfor i, locator in enumerate(locators):\n plt.subplot(n_locators, 1, i + 1)\n ax = tickline()\n ax.xaxis.set_major_locator(eval(locator))\n plt.text(5, 0.3, locator[7:], ha=\"center\")\n\nplt.subplots_adjust(bottom=0.01, top=0.99, left=0.01, right=0.99)\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.12.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
}
|
||||
Reference in New Issue
Block a user