43 lines
1.6 KiB
Plaintext
43 lines
1.6 KiB
Plaintext
|
|
{
|
||
|
|
"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
|
||
|
|
}
|