Files
jupyter-collection/scientific-computing-2/auto_examples_jupyter_2/plot_subplot-horizontal.ipynb
2025-10-21 11:20:44 +08:00

43 lines
1.3 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Horizontal arrangement of subplots\n\nAn example showing horizontal arrangement of subplots with matplotlib.\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n\nplt.figure(figsize=(6, 4))\nplt.subplot(2, 1, 1)\nplt.xticks([])\nplt.yticks([])\nplt.text(0.5, 0.5, \"subplot(2,1,1)\", ha=\"center\", va=\"center\", size=24, alpha=0.5)\n\nplt.subplot(2, 1, 2)\nplt.xticks([])\nplt.yticks([])\nplt.text(0.5, 0.5, \"subplot(2,1,2)\", ha=\"center\", va=\"center\", size=24, alpha=0.5)\n\nplt.tight_layout()\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
}