L1-python/source/Plotting1.ipynb

484 lines
116 KiB
Plaintext
Raw Permalink Normal View History

2023-01-18 07:54:52 +00:00
{
"cells": [
{
"cell_type": "markdown",
"id": "f8579363",
"metadata": {},
"source": [
"# **Libraries**"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "e4d24b04",
"metadata": {},
"outputs": [],
"source": [
"# libraries\n",
"import scipy \n",
"# \"SciPy\" provides algorithms for optimization, integration, interpolation, eigenvalue problems, \n",
"# algebraic equations, differential equations, statistics and many other classes of problems.\n",
"import numpy as np\n",
"# Fast and versatile, the \"NumPy\" vectorization, indexing, and broadcasting concepts are the \n",
"# de-facto standards of array computing today.\n",
"import matplotlib.pyplot as plt\n",
"# \"Matplotlib\" is a comprehensive library for creating static, animated, and interactive \n",
"# visualizations in Python."
]
},
{
"cell_type": "markdown",
"id": "4c41a20d",
"metadata": {},
"source": [
"## Data"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "9e9a38b3",
"metadata": {},
"outputs": [],
"source": [
"x= np.linspace(0,2*np.pi)\n",
"y= np.sin(x)"
]
},
{
"cell_type": "markdown",
"id": "6a8dcbb5",
"metadata": {},
"source": [
"## Anatomy of a figure"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "b5768c9e",
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"from PIL import Image\n",
"img = Image.open('anatomy.webp')\n",
"img.save(\"anatomy.png\")"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "8f75cee3",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"anatomy.png\" width=\"500\" height=\"500\"/>"
],
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# import image module\n",
"from IPython.display import Image\n",
" \n",
"# get the image\n",
"Image(url=\"anatomy.png\", width=500, height=500)"
]
},
{
"cell_type": "markdown",
"id": "82c13c31",
"metadata": {},
"source": [
"## Implicit or explicit?\n",
"**Using figures**\n",
"- Explicitly create Figures and Axes, and call methods on them (the \"object-oriented (OO) style\").\n",
"- Rely on pyplot to implicitly create and manage the Figures and Axes, and use pyplot functions for plotting."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "0f84f0db",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEWCAYAAABBvWFzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi41LCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvSM8oowAAIABJREFUeJzt3Xl4VOX5//H3nY1AgAAhBEKAsIRAWIUIIi7sAqKobanU3VrKVxFFrUvVarVaa+tWtSogonXHpVIFBHFBUIQEkC0sIWxhDVsSQkK2+/fHDP4iTcgkmeTMZO7Xdc01M2eZ+RyX3PM855znEVXFGGOMqakgpwMYY4ypH6ygGGOM8QorKMYYY7zCCooxxhivsIJijDHGK6ygGGOM8QorKMZUQkSuEpGFtfTZs0XkL7XwuTtEZIS3P9eYM7GCYgwgIueJyHciki0iR0RkmYicDaCqb6nqKKcznk5EVETyROS4iOwRkadFJLiKnzFERDJrK6MJLCFOBzDGaSLSFPgU+D/gfSAMOB846WQuD/VR1XQR6QZ8DWwBXnY2kglU1kIxBroCqOo7qlqiqvmqulBV1wKIyPUisvTUxu6Wwc0islVEckXkURHpLCLfi0iOiLwvImHubYeISKaI/FFEDrm7oq6qKIiIjBORNSJyzN1i6u3JAajqJuBboGc5n9lARJ4Vkb3ux7PuZRHAfCDW3co5LiKxVfkHZ0xZVlCMcf2qLxGR10VkjIg092Cf0UB/4BzgbmA6cBXQDtcf9Ylltm0NtATaAtcB00Uk8fQPFJF+wCzg90AU8AowV0QaVBZGRJJwtapWl7P6fnfOvkAfYADwgKrmAWOAvara2P3YW/mhG1M+Kygm4KlqDnAeoMAMIEtE5opIzBl2+5uq5qjqBmA9sFBVM1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/1zK2ZR13JIsx/mLdunUMGDCAvn378thjj3n9/IgnAmpO+eTkZLUJtn7uaF4h17+2gh8zs7lhcDz3jO7mU/eHrNxxhMn/TqWwpJQXf9OPC7pWOmmcMXUuLS2N7t27Ox3DK8o7FhFJVdXkyva1FkoAO5hTwJXTl5O2P5dXrunPQ5f08KliAnB2fAs+mTKYts0acv1rK3h16XYC6UeQMf7ECkqA2n3kBL965Xt2Hz3B7OvP5qIerZ2OVKG45o348P/OZUT3GB79dCP3fLiWwuJSp2MZY05jBSUAbcs6zoRXvudoXiFv3jSQc7u0dDpSpSIahPDy1f25dVgX3k/JZNp7aygptZaK8R31oeVc02Owq7wCzIa92Vz76gpE4L3fD6J7m6ZOR/JYUJBw56hEmoaH8ti8NBqFBfO3X/R27OIBY04JDw/n8OHDfj2E/an5UMLDw6v9GVZQAkjqziNc/9pKmjQI4c2bBtIpurHTkarldxd0IvdkMf9cvJWIBiE8dEmS3/5PbOqHuLg4MjMzycrKcjpKjZyasbG6rKAEiM37c7lu1kqimzTgzZsGev2u97o2bUQCxwuKmbVsO03DQ7hjVKLTkUwACw0NrfYsh/WJFZQAcDC3gBtnrySiQTBv/25grd/5XhdEhAfHdSfvZDH//DKdiAYh/P7Czk7HMiagWUGp5/ILS7jp9RSO5BUyZ/KgelFMThERHr+iF3mFxfx1/iYah4dw1cAOTscyJmBZQanHSkuV299bzbo92Uy/JrlGowT7quAg4Zlf9yW/sIQH/rOeyIahjOsd63QsYwKSXTZcjz2xYBOfbzjAgxcnMTLJu/Me+JLQ4CBevKof/ds35w9z1rJpv3eHDjfGeMYKSj311g87mb4kg2sHdeCGwfFOx6l14aHB/OuqfjQOD2Hyv1PJzi9yOpIxAccKSj30zZYs/vTJBoYkRvOncYFzSW2rpuG8dFU/Mo/mc+f
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# implicit \n",
"plt.plot(x,y,label=\"sin\")\n",
"plt.xlabel('x label')\n",
"plt.ylabel('y label')\n",
"plt.title(\"Simple Plot\")\n",
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "3f2d03de",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7fcca3b14dc0>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAACnCAYAAAAPOxtMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAjU0lEQVR4nO3deXxV1bn/8c+TmUwkkARIQphHQQKEEEAUq1Wpc2sFBRUtk4q9vd5qtXpvW69aa+/PWrUqAVRUQFBrRaU4VBFQwhAUkDkgQwiQABnIPD2/P87BIoaQeZ+TPO/XK6+cYZ+9n0NIvmettfdaoqoYY4wxZ+PjdAHGGGM8mwWFMcaYWllQGGOMqZUFhTHGmFpZUBhjjKmVBYUxxphaWVAYA4jIJBH5qJn2/YqIPNoM+90nIpc29X6NOZMFhWkzROQCEflSRPJF5ISIfCEiIwBUdYGqXuZ0jWcSERWRIhEpFJFDIvKUiPjWcx/jRCSzuWo0rZ+f0wUY0xJEJBx4H7gTWAIEAGOBMifrqqMhqpohIv2BFcAu4EVnSzJtibUoTFvRF0BVF6lqlaqWqOpHqroZQESmiMjqUxu7P8nfJSK7ReSkiPyviPQSkTUiUiAiS0QkwL3tOBHJFJHfisgxd5fQpLMVIiJXicjXIpLnbuGcX5c3oKo7gFXAoBr2GSgiT4tIlvvrafdjIcA/gVh3q6RQRGLr8w9njAWFaSt2AVUiMl9ExotIZB1ecwUwHEgB7gdSgUlAV1x/rG86bdvOQBQQB9wGpIpIvzN3KCLDgJeAGUBHYDawVEQCz1WMiAzE1Qr6qoanH3LXmQgMAZKBh1W1CBg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with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# explicity\n",
"fig = plt.figure(figsize=(6,6)) # size\n",
"ax = plt.subplot(aspect=1) # aspect ratio\n",
"ax.plot(x,y,label=\"sin\") # label\n",
"ax.set_xlabel('x') # Add an x-label to the axes.\n",
"ax.set_ylabel('y') # Add a y-label to the axes.\n",
"ax.set_title(\"Simple Plot\") # Add a title to the axes.\n",
"ax.legend() # Add a legend."
]
},
{
"cell_type": "markdown",
"id": "9d5ac225",
"metadata": {},
"source": [
"### Figure : lines"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "568d7656",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7fdc69fe4b90>"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAACnCAYAAAAG0Ls2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi41LCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvSM8oowAAIABJREFUeJzt3XeYlPXV8PHvWXpTFFCQIqigKCoCodiCUVGiCZpoAtbYUB/RJIo9Ppboq49GY9SoCFhjAMUoKIqKiqCCUpReRIosK73uUpc97x9nJrNllp3Z3Zl7yvlc11zM3HPPzBl2d8786hFVxTnnnItVTtABOOecSy+eOJxzzsXFE4dzzrm4eOJwzjkXF08czjnn4uKJwznnXFw8cTgHiMjFIvJRgp77ZRF5MAHPu1xEzqju53WuIp44XNYQkZNF5CsR2SIiG0XkSxH5GYCqvq6qfYKOsTQRUREpEJF8EVklIk+ISI04n6O3iOQmKkaXfWoGHYBzySAi+wHvAdcDbwC1gVOAXUHGFaPjVXWJiBwFTAQWA88HG5LLZt7icNmiA4CqjlDVvaq6Q1U/UtXZACLyBxH5Inxy6Jv+/4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3mwt2J07M2NvmOOOs1+km2+GDz8MOpq04YPjKWrRIhvwnTMncqxJE3j2Wfjd76I8YM8em1Y1ezZ06JBas1qqyxdf2F7vgweXuauoCB5/3Hogiu+8O2AAPPcc7L9/EuPMREVFMHYs9Otn1zNtl8pdu6z1NGeO1QN
"text/plain": [
"<Figure size 432x432 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure(figsize=(6,6))\n",
"ax = plt.subplot(aspect=1)\n",
"ax.plot(x,y,label=\"sin\",color='blue', linewidth=3, linestyle='--') \n",
"ax.plot(x,y*y,label=\"$\\sin^2$\",color='red', linewidth=1, linestyle='dotted') \n",
"ax.set_xlabel('x') # Add an x-label to the axes.\n",
"ax.set_ylabel('y') # Add a y-label to the axes.\n",
"ax.set_title(\"Simple Plot\") # Add a title to the axes.\n",
"ax.legend() # Add a legend."
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "b316fd3f",
"metadata": {},
"outputs": [],
"source": [
"ax.plot?"
]
},
{
"cell_type": "markdown",
"id": "287d0813",
"metadata": {},
"source": [
"## Figure and Axes"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "7cbcc514",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0,0.5,'y')"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAACbCAYAAAB1aHzgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi41LCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvSM8oowAAGWpJREFUeJzt3X2QXGWVx/HvSZNhIokGSFRgEie7pRYlKYHMhmosY+MoJIHaBNi1VGJQqohuhY3WFhpZja6CxN0q8b1gA0TMbgS2iEJqBRIY6BLIuCYTRAiwhGLHzZBoIOsLKNB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Z89H3jW3Z8rfc5twBJgbOJYAmwoLRf7czObbmYnufu+BscCQP8968gPbCI372Kyi1YUn1NJSkqCepJBrcP+Lui91Cgcgo5JRl8XZAn+TlVrZaon2z7qKWGVO381Sy09jrdS7A3sBNYDWxq07vcpwJ4xj4c4ujdRbp9TgIYnjv571tH7yCcpZKDjka30AdlFK1SSkqqCWof5wTwFP8gwTsEPjn53gr5T6sXKWGFKWEHnr2aZVG0Hd/8ixVLRzcDHgd1mdq2Z/eUEP9vKfVwd+xR3NFthZjvMbMcLL7wQOpj8wCYKGRieBIVJxcdw+KSQsYwOZilrpHV49TlXj2sBBn13gp4Peh+REUHfnaDzV7PUNMbh7m5mvwF+AxwEjgfuMLP73P1zdX72EDBrzOMuYG8d+4zEuA5YB8ULAMMGk5t3MR2PbKXg0HGo+BhUW5balGsdBn13srOy9J35rWJZ4cyLVY6SmgV9p4LOX81S9cpxM1s
"text/plain": [
"<Figure size 432x432 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"#\n",
"fig = plt.figure(figsize=(6,6))\n",
"ax = plt.subplot(aspect=1)\n",
"ax.plot(x,y,\".r\",label=\"$\\sin(x)$\") \n",
"ax.plot(x,y*y,\".g\",label=\"$\\sin(x)^2$\") \n",
"ax.legend()\n",
"ax.set_xlabel(\"x\")\n",
"ax.set_ylabel(\"y\")"
]
},
{
"cell_type": "markdown",
"id": "cf3594a3",
"metadata": {},
"source": [
"### Figures : axes and text"
]
},
{
"cell_type": "code",
"execution_count": 47,
"id": "8cd16580",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0,0.5,'y')"
]
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAACnCAYAAAAG0Ls2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2Z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3Z/W3337L+eefH3R8JjhODo63BnLLPM8Devpod4mIbAB2ARNV9WtfOxORMcAYgLZt21ZzqNXDBsHdwwbNK3feeeexYMECfvOb39ChQwfuvPNO4uLiePHFF7nuuutKB8fHjh0b9D6HDx/OHXfcwVNPPcXbb79dbpxj4MCBjBw5svT5gw8+yJYtW4iJiaFdu3alV1Tt3r27dLC7RYsWTJo0iYsvvhiA9PT00oHyvXv3Eh8fT6tWrar8d2HKc+xyXBG5DrhaVUd7n48EeqjqPWXaJALFqnpURK4B/qqqHSrbt1svx33m463MyNhCsUI9gfFpnRh3ZXunwzKmgpycHAYPHkx2dnZEP/eXv/wlf/nLX+jQwf9/81mzZtG2bVuGDh0acF8zZ84kMTGR22+/vbrDrJVCuRzXyVJVHtCmzPMkPL2KUqp6WFWPeh8vBWJFpGXkQqxeVh6JDnXhaqusrCyGDBlCt27dKC4udjqcUn/+85/ZvXt3wDZ33313pUkDoFmzZtxyyy3VFZopw8keR33gW6AfsBP4ErixbClKRM4A9qqqikgP4G2gnVYStFt7HGA3+rldbS4nqioZGRmkp6eTnZ1Nfn4+jRs3ZtGiRQwaNMjp8IzDouIGQFUtEpG7geVAPWC
"text/plain": [
"<Figure size 432x432 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# adding text\n",
"fig = plt.figure(figsize=(6,6))\n",
"ax = plt.subplot(aspect=1)\n",
"ax.plot(x,y,\".\",label=\"sin\") \n",
"ax.legend()\n",
"\n",
"\n",
"ax.text(0.3, 0.1, \"-> Mot\",family=\"cursive\",size=14)\n",
"ax.text(0.3, -0.5, \"-> Mot\",family=\"serif\",size = 14)\n",
"\n",
"ax.annotate('point (3,0)', xy=(3, 0), xytext=(4, 0.5),\n",
" arrowprops=dict(facecolor='black', shrink=0.05))\n",
"\n",
"ax.set_title('Title')\n",
"ax.set_xlabel(\"x\")\n",
"ax.set_ylabel(\"y\")\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "977fb62b",
"metadata": {},
"source": [
"### figure : scales"
]
},
{
"cell_type": "code",
"execution_count": 51,
"id": "5f4d1736",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7fdc5860e790>"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEtCAYAAAAfjIc8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi41LCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvSM8oowAAIABJREFUeJzt3Xd81dX9P/DX+97cmwkJGYQRQsKesgIEXNUqRQT9uRmKzIDWqv0WZ7W1Vtuvtr9W60BDwCgyRa0yqnXUBSRA2IQhmwsESICEjJvk5p7vHyEppYzc5HPvufdzX8/HIw/Nzc29b+O9n9c9W5RSICIiaiiL7gKIiCiwMDiIiMgjDA4iIvIIg4OIiDzC4CAiIo8wOIiIyCMMDiIvEZGnRSTrEj+fICI/+LImIiOE6C6AKFCJSOk530YAqARQc/b7aUqpP5xz3xQA+wDYlFIuX9VI5A0MDqJGUkpF1f27iOwHMEUp9aW+ioh8g11VRF4iIs+JyPtnv/3u7D9Pi0ipiAy5wP27icgXInJSRHaKyN2+q5ao4RgcRL5xzdl/xiilopRSq8/9oYhEAvgCwHwALQGMAfCmiPT0bZlEl8fgIPIPIwHsV0q9o5RyKaXWA/gQwJ2a6yL6LxzjIPIP7QEMFpHT59wWAmCupnqILorBQeQbl9uG+hCAb5VSN/qiGKKmYFcVkW+cAOAG0OEiP18GoIuI3CcitrNfA0Wku+9KJGoYBgeRDyilygG8CGCliJwWkfTzfn4GwDAAowEcAVAA4CUAob6ulehyhAc5ERGRJ9jiICIijzA4iIjIIwwOIiLyCIODiIg8wuAgIiKPmHIBYHx8vEpJSdFdBhFRwMjLyytUSiU05L6mDI6UlBSsW7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
},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure(figsize=(6,6)) # size\n",
"ax = plt.subplot(aspect=1) # aspect ratio\n",
"\n",
"ax.plot(x,y,label=\"sin\") # label\n",
"ax.set_xscale('log')\n",
"ax.set_yscale('log')\n",
"ax.set_xlabel('x') # Add an x-label to the axes.\n",
"ax.set_ylabel('y') # Add a y-label to the axes.\n",
"ax.set_title(\"Title\") # Add a title to the axes.\n",
"ax.legend() # Add a legend."
]
},
{
"cell_type": "markdown",
"id": "b2266d48",
"metadata": {},
"source": [
"### figures multiples"
]
},
{
"cell_type": "code",
"execution_count": 72,
"id": "45b0275c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7fdc69e73190>]"
]
},
"execution_count": 72,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbMAAAG0CAYAAAC46Mk/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi41LCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvSM8oowAAIABJREFUeJzsvXl0ZPd13/m9ta9YqlDoRqPRbHazmxJFmhTVouhoIbXQQ2lsUfI4E2kmtuxjmaOx6IntOZkw8RxNMsdJ5Iw98nisWKEdWfLElmzHYkRb1B5rtSQTFCmySfbGJpoNoAHUAqA21KvtN3+89wpFNLZCveX3e+9+zunTqHrvVf3YuLz3/u72IyEEGIZhGEZlAm4vgGEYhmGGhY0ZwzAMozxszBiGYRjlYWPGMAzDKA8bM4ZhGEZ52JgxDMMwysPGjGEYRlGI6BgRVYkouMs9gohucnJdbsDGjGEYRiGIaI6I3gEAQoiXhRApIUTHuPYNIvqguyt0BzZmDMMwjPKwMXMYInqYiF4kogoRPU9E73V7TQzDqAER/X8AjgH4ayO8+L8ZYcQQEf1rAG8G8PvGtd/f5vkoEf02Eb1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ugIXl6sDedmA7mkfyybwYr5q08oYWTm/VEYyEsT0WHyg507mklitt1CqNW1aGSMjLxVqaHfFwMbsRE6fLPNinndm+8XXxuxKsQat3cXpAQUN0I+EYUHzH+eXKzh9OD3w4YknJ/XkPztA/uLcUhnA4Dv5ZDSEqdEYXlxhedkvvjZm5hZ+0Hg2oBuzK8Ua2h0+DsYvCCEOlP8AgJtyujG
"text/plain": [
"<Figure size 432x432 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig, (ax0, ax1, ax2) = plt.subplots(nrows=1, ncols=3,\n",
" figsize=(6, 6))\n",
"fig.tight_layout()\n",
"ax0.set_title('a')\n",
"ax0.plot(x,y,label=\"sin\") # label\n",
"\n",
"ax1.plot(x,y,label=\"sin\") # label\n",
"\n",
"ax2.set_title('title')\n",
"ax2.plot(x,y,label=\"sin\") # label\n"
]
},
{
"cell_type": "markdown",
"id": "fecf66d0",
"metadata": {},
"source": [
"### figure : save"
]
},
{
"cell_type": "code",
"execution_count": 71,
"id": "2f6abdd2",
"metadata": {},
"outputs": [],
"source": [
"#save\n",
"fig.savefig(\"output.png\")\n",
"fig.savefig(\"output.pdf\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}