388 lines
97 KiB
Plaintext
388 lines
97 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Matplotlib Exercices - Solutions \n",
|
||
|
"\n",
|
||
|
"Bienvenue sur les exercices de révision de matplotlib! Prenez votre temps surtout, Matplotlib peut être difficile à comprendre au début. Ce sont des tracés relativement simples, mais ils peuvent être difficiles si c'est la première fois que vous utilisez matplotlib, n'hésitez pas à vous référer aux solutions au fur et à mesure que vous avancez.\n",
|
||
|
"\n",
|
||
|
"Ne vous inquiétez pas non plus si vous trouvez la syntaxe matplotlib frustrante, nous ne l'utiliserons pas souvent tout au long du cours, nous allons passer à l'utilisation des capacités de visualisation intégrées de pandas. Mais, ceux-ci sont construits à partir de matplotlib, c'est pourquoi il est toujours important d'y être exposé !\n",
|
||
|
"\n",
|
||
|
"**NOTE : TOUTES LES COMMANDES POUR TRACER UNE FIGURE DOIVENT ÊTRE PRESENTES DANS LA MÊME CELLULE. LES SÉPARER EN PLUSIEURS CELLULES PEUT NE RIEN FAIRE APPARAÎTRE.**\n",
|
||
|
"\n",
|
||
|
"# Exercices\n",
|
||
|
"\n",
|
||
|
"Suivez les instructions pour recréer les tracés à l'aide de ces données:\n",
|
||
|
"\n",
|
||
|
"## Données"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import numpy as np\n",
|
||
|
"x = np.arange(0,100)\n",
|
||
|
"y = x*2\n",
|
||
|
"z = x**2"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Importer matplotlib.pyplot en tant que plt et définir %matplotlib inline si vous utilisez le notebook jupyter. Quelle commande utilisez-vous si vous n'utilisez pas Jupyter Notebook?**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"%matplotlib inline"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Exercice 1\n",
|
||
|
"\n",
|
||
|
"**Suivre ces étapes**\n",
|
||
|
"* **Créer un objet Figure qu'on nomme fig en utilisant plt.figure()**\n",
|
||
|
"* **Utiliser add_axes pour ajouter un axe sur le canevas de la figure à [0,0,1,1]. Appeler ce nouvel axe ax.**\n",
|
||
|
"* **Tracer (x,y) sur ces axes et définir les étiquettes et titres pour correspondre au graphique ci-dessous:**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"Text(0.5, 1.0, 'title')"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeYAAAFdCAYAAADWns55AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAbgElEQVR4nO3de5Bc5Xnn8e8DGBsjbzBGEFkwCGzZYNhEtmctLWxY1jgJYknAKXCgwmWJQXYVVEyKGATxmqzJxbGxiSlSBNlgYAswBHzBLBVMiF3gcFmNwIUBWctNgIwiCYvbBi1Co2f/6KO4GfVIc+nT53Sf76dqarrfPj39zJnT5zdPv+d0R2YiSZLqYYeqC5AkSb9kMEuSVCM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7ZNXKDiX+7KuBI8eM3QkcnJm/Bvwf4Py2257MzHnFl6Esqas2bBzlC99/jE9ccR9vjG7m+tPnc9GxBxvKqp3StsjMvLvohNvHftB29X7guLIeX5K2aO+ST1owxPkLD2RXA1k1VeWW+YfAjW3X94uIh4BXgM9l5j2d7hQRi4BFAENDQ6UXKal/tc8lz97NuWT1h0qCOSL+FNgEXFcMrQaGMvMXEfFh4LsRcVBmvjL2vpm5BFgCMDw8nL2qWVJ/GTuXvHjhAXbJ6gs930oj4lRaB4UdkZkJkJmvA68Xl5dFxJPA+4CRXtcnqb/ZJavf9TSYI+JI4DzgP2fma23jM4H1mTkaEfsDc4GnelmbpP7Xfl6yXbL6VZmnS90AHA7sERGrgAtpHYX9VuDOiIBfnhZ1GPCFiNgEjAKfzsz1ZdUmabDYJWuQlHl
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.add_axes([0,0,1,1])\n",
|
||
|
"ax.plot(x,y)\n",
|
||
|
"\n",
|
||
|
"ax.set_xlabel('x')\n",
|
||
|
"ax.set_ylabel('y')\n",
|
||
|
"ax.set_title('title')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Exercice 2\n",
|
||
|
"**Créez un objet Figure et placez-y deux axes, ax1 et ax2: situés à [0,0,1,1] et [0.2,0.5,.2,.2] respectivement.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAd0AAAFDCAYAAAB/UdRdAAAAB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+/n+3bt7N///6T1nzrW9/iYx/7GBMTE3zpS1/iq1/9apumlSQ1g9Ftk+eee47+/n6uvvpqFixYwLp16xgZGTlpzcjICHfccQcAa9as4ZlnniEz2zGuJKkJjG6bTE1N0dfXd+K4VqsxNTV12jU9PT0sXLiQt956q+ickqTm6Wn3AOeruV6xRsQZrwEYHh5meHgYgJdeeol6vd6kKVvv8OHD9Pb2tnuMSl555ZV2jyCpwxndNqnVahw8ePDE8eTkJIsXL55zTa1W49ixY7zzzjssWrTolOcaGhpiaGgIgHq9ztjYWGuHb6JOmreT/mdG0rnJ08ttsnLlSsbHx3n99dc5evQoO3bsYHBw8KQ1g4ODfOc73wHgySef5DOf+cycr3QlSZ3BV7pt0tPTw5YtW7jppps4fvw4Gzdu5Prrr2fz5s3U63UGBwe58847+cIXvkB/fz+LFi1ix44d7R5bkvQBGN02GhgYYGBg4KT7HnzwwRO3L7roIp544okzes5fn2buFJ00byfNKuncFO36FZR6vZ6d8l6eJEm/FhF7M/OsPuThe7qSJBVidDtUJ11Ccr5Zt23bRm9vLytWrGDFihU88sgjbZiyYePGjVx22WUsW7Zszsczk/vuu4/+/n6WL1/OCy+8UHhCSZ3M6HagTrqEZJVZAdauXcuLL77Iiy++yBe/+MU2TNqwYcMGdu/efdrHd+3axfj4OOPj4wwPD3P33XcXnE5SpzO6HaiTLiFZZdZzyY033jj
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 2 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fig = plt.figure()\n",
|
||
|
"\n",
|
||
|
"ax1 = fig.add_axes([0,0,1,1])\n",
|
||
|
"ax2 = fig.add_axes([.2,.5,.2,.2])"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Tracer maintenant (x,y) sur les deux axes. Afficher le résultat.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"metadata": {
|
||
|
"scrolled": true
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeYAAAFNCAYAAADVSMziAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de7ScdX3v8ffXpNQCQaAkEAkh0KQeBGnEHeV4YUHSVExdifVCQSyRcJoSYGHFHkyR2tpiT8KpDbi4dKUNJlgFRahhaeAUg9ZDLMgOUIJgzwaNkrjNpSHetsrF7/ljZsNkZ3aybzPPMzPv11p77Znf3L48TPLN5/k9v+eJzESSJJXDy4ouQJIkvcTGLElSidiYJUkqERuzJEklYmOWJKlEbMySJJXI+KILGI0jjjgip02bVnQZkiQNy8aNG3dm5sR6j7V0Y542bRrd3d1FlyFJ0rBExPcGe8xd2ZIklYiNWZKkErExS5JUIjZmSZJKxMYsSVKJNKwxR8QxEfHViHgiIr4VER+ojh8eEfdERE/192HV8YiIT0bEkxHxaESc0qjaJEkqq0Ym5ueBD2XmCcCpwMUR8WpgKbA+M2cA66v3Ad4GzKj+LAZubGBtkiSVUsMac2b2ZuZD1ds/AZ4AjgYWAGuqT1sDvKN6ewFwc1bcDxwaEZMbVZ8kSWXUlDnmiJgGvBZ4ADgyM3uh0ryBSdWnHQ08XfOyLdWxge+1OCK6I6J7x44djSxbkqSma3hjjoiDgduBP83MH+/rqXXGcq+BzJWZ2ZWZXRMn1j2bmSRJY+uXv2zaRzW0MUfEr1Fpyp/JzDuqw9v6d1FXf2+vjm8Bjql5+RTgB42sT5Kk/dqwAV7zGrjttqZ8XCOPyg5gFfB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cKFnH766Sxfvpy1a9dy3nnnERGceuqp7N69m97e3hffo55p06bR3d3djP+c9vbjH8Mhh7x4t6urq8BiVIjaI66nToWvfAXmzCm6KpWYu7Jb3ObNm3n44Yd5wxvewLZt215stpMnT2b79u0AbN26lWOOeenEalOmTGHr1q17vdfKlSvp6uqiq6sLz0M+Srt3V9LRrFmVv5jVmWrP3nXhhZWzd9mUtR825hb205/+lHe9611cc801HFKTygbK3Pu04xF7n5588eLFdHd3093djechH4V16+DEE+HTn4Z3vxvGeQXTjlM7l/zss7B+PdxwA0yYUHRlagE25hb13HPP8a53vYtzzz2Xd77znQAceeSR9Pb2AtDb28ukSZOASkJ++umXLt61ZcsWXvnKVza/6HbXn5J///fhsMPg/vvh4x+HX//1oitTM9VLybNnF12VWoiNuQVlJhdccAEnnHACl1122Yvj8+fPZ82aNQCsWbOGBQsWvDh+8803k5ncf//9vOIVr9jn/LJGoDYlX3EFbNwIzid3FlOyxogHf7WgDRs28OlPf5rXvOY1zJw5E4C//du/ZenSpZx11lmsWrWKqVOncttttwEwb9481q1bx/Tp0znwwAP51Kc+VWT57WX3bvjgB2H16kpjXrvWhtyJBh5xvXy5DVkjZmNuQW9+85vrzhsDrF+/fq+xiOD6669vdFmdZ906+OM/hm3bKin5ox91t3WnGXjE9fr17rbWqLkrWxou55IFziWrYWzM0nA4lyznktVgNmZpKEzJAlOymsLGLO2PKVmmZDWRjVkajClZYEpW09mYpXpMyTIlqyA2ZqmWKVlgSlahbMxSv7vuMiV3OlOySsDGLPWn5HnzTMmdzJSskrAxq7M5l6yBKfkrXzElq1A2ZnUm55IFXi9ZpWRjVucxJauvr3LxEeeSVUINa8wRcVNEbI+Ix2rG/ndEfDs
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 2 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 5,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"ax1.plot(x,y,color='r')\n",
|
||
|
"ax1.set_xlabel('x')\n",
|
||
|
"ax1.set_ylabel('y')\n",
|
||
|
"\n",
|
||
|
"ax2.plot(x,y,color='r')\n",
|
||
|
"ax2.set_xlabel('x')\n",
|
||
|
"ax2.set_ylabel('y')\n",
|
||
|
"\n",
|
||
|
"fig # Afficher l'objet figure"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Exercice 3\n",
|
||
|
"\n",
|
||
|
"**Créer le tracé ci-dessous en ajoutant deux axes à un objet figure à [0,0,1,1] et [0.2,0.5,.4,.4].**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 6,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAd0AAAFDCAYAAAB/UdRdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAcq0lEQVR4nO3dcXBU9b338c+3RmTs7UVUmIobC+nSSMIEaTca62il9CmQsaF/YBqcSrk6xmp6naFObZ+5j1zL1SlPnXpnFLR3LZX2Mje5lD9uMhriFCv2jiPiKs91QtQEBc1Gpya2orVFBL7PH4lpQoI5hN3fyYb3a2Zn9pzzy8lnfuzkwzl79qy5uwAAQP59Ku4AAACcLihdAAACoXQBAAiE0gUAIBBKFwCAQChdAAACGbN0zeyXZva2mbWfYLuZ2f1mts/MXjSzL+Y+JgAAhS/Kke5mSUs/YfsySXMHHvWSHjr1WAAATD5jlq67/17SHz9hyHJJv/Z+uySdY2YX5CogAACTRS7e071QUveQ5ezAOgAAMERRDvZho6wb9d6SZlav/lPQ+vSnP/2liy++OAe/HgCAcJ5//vk+d58xnp/NRelmJRUPWU5IenO0ge6elpSWpFQq5ZlMJge/HgCAcMzs9fH+bC5OL7dIWjVwFXOVpIPu/lYO9gsAwKQy5pGumTVKulrS+WaWlfTPks6UJHf/uaRWSdWS9kn6i6R/yFdYAAAK2Zil6+4rx9jukhpylggAgEmKO1IBABAIpQsAQCCULgAAgVC6AAAEQukCABAIpQsAQCCULgAAgVC6AAAEQukCABAIpQsAQCCULgAAgVC6AAAEQukCABAIpQsAQCCULgAAgVC6AAAEQukCABAIpQsAQCCULgAAgVC6AAAEQunG6IYbbtDMmTM1f/78Ube7u2677TYlk0lVVFTohRdeCJwQAJBLlG6MVq9erba2thNu3759u7q6utTV1aV0Oq1bbrklYDoAQK5RujG66qqrdO65555we3Nzs1atWiUzU1VVld5991299dZbARMCAHKJ0p3Aenp6VFxcPLicSCTU09MTYyIAwKkoijsATszdR6wzsxHr0um00um0JOnll1/WxRdfnPdsQK4cOHBAfX19cccAgqB0J7BEIqHu7u7B5Ww2q1mzZo0YV19fr/r6eklSKpVSJpMJlhE4ValUKu4IQDCcXp7Aampq9Otf/1rurl27dmnatGm64IIL4o4FABgnjnRjtHLlSu3cuVN9fX1KJBL68Y9/rI8++kiS9N3vflfV1dVqbW1VMpnU2WefrUceeSTmxACAU0HpxqixsfETt5uZNm7cGCgNACDfOL0MAEAglC4AAIFQugAABELpAgAQCKULAEAglC4AAIFQugAABELpAgAQCKULAEAglC4AAIFQugAABELpAgAQCKULAEAglC4AAIFQujFqa2tTaWmpksmk1q9fP2L7G2+8oUWLFmnhwoWqqKhQa2trDCkBALlC6cbk6NGjamho0Pbt29XR0aHGxkZ1dHQMG3P33XertrZWe/bsUVNTk2699daY0gIAcoHSjcnu3buVTCZVUlKiKVOmqK6uTs3NzcPGmJnee+89SdLBgwc1a9asOKICAHKkKO4Ap6uenh4VFxcPLicSCT377LPDxtx11136+te/rgceeEAffPCBduzYETomACCHONKNibuPWGdmw5YbGxu1evVqZbNZtba26vrrr9exY8dG/Fw6nVYql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W5iogAACTRZQvPLBR1h3/DexFkuZKulpSQtJ/m9l8d3932I7M6iXVS9JFF1100mEBAChkUY50s5KKhywnJL05yphmd//I3fdLekX9JTyMu6fdPeXuKb5sHQBwuolSus9Jmmtmc8xsiqQ6Scd
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 2 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fig = plt.figure()\n",
|
||
|
"\n",
|
||
|
"ax1 = fig.add_axes([0,0,1,1])\n",
|
||
|
"ax2 = fig.add_axes([.2,.5,.4,.4])"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Utiliser maintenant les tableaux x, y et z pour recréer le graphique ci-dessous. Notez les limites x et y sur le tracé inséré:**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 7,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfIAAAFNCAYAAAD7De1wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de5zOZf7H8ddlJiQVlZHzqSmiMRix6SBCSqTkEGsq7XQu2lW22tpOP6m20olmkalVSMJiEaPDKjGiLbHrGIMYxjjlMGau3x/XlyZmmBkz9/c+vJ+Px/2Y+77u7/eez3136z3X93t9r8tYaxEREZHQVMbvAkRERKT4FOQiIiIhTEEuIiISwhTkIiIiIUxBLiIiEsIU5CIiIiEs2u8CAu28886zdevW9bsMERGRIlmyZMl2a22VY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eBBGttEyAK6A0MA1611sYCO4EB3i4DgJ3W2guAV73tMMZc7O3XGLgWeNsYE0H/6U7d9OnTiYmJoUWLFr9pHzp0KCtXrmTx4sVkZmYybNiwfPdPSkoiLS2NtLQ0qlSpEoiSRUSOs3s33HCDOz8+bRqcdZbfFQWWX4fWo4HTjTHRQAVgC9AOmOQ9nwLc6N3v5j3Ge769McZ47eOttQetteuA1cClAao/LCxYsIBp06ZRt25devfuTWpqKv369aNatWoYYyhXrhy33347ixYt8rtUEZF85eRAnz7w3//CpEl
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 2 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 7,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"# large\n",
|
||
|
"ax1.plot(x,z,color='b')\n",
|
||
|
"ax1.set_xlabel('X')\n",
|
||
|
"ax1.set_ylabel('Z')\n",
|
||
|
"\n",
|
||
|
"# insert\n",
|
||
|
"ax2.plot(x,y,color='b')\n",
|
||
|
"ax2.set_xlabel('x')\n",
|
||
|
"ax2.set_ylabel('y')\n",
|
||
|
"ax2.set_title('zoom')\n",
|
||
|
"\n",
|
||
|
"ax2.set_xlim([20,22])\n",
|
||
|
"ax2.set_ylim([30,50])\n",
|
||
|
"\n",
|
||
|
"fig"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Exercice 4\n",
|
||
|
"\n",
|
||
|
"**Utiliser plt.subplots(nrows=1, ncols=2) pour créer le tracé ci-dessous.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 8,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAA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6GvKSDlV1Ajixbt97Z26/aeS+pLlzrtWNV9pKUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhMGviQ1YeBLUhODAj/J/iRnkqwmuXuD+385yaen938tyXVjNyrNg7OtTjYN/CRXAUeBW4F9wOEk+9YtuxN4sqp+HfgQ8NdjNyqNzdlWN0PO8G8GVqvqbFU9BdwHHFy35iDwsentzwJvTJLx2pTmwtlWKzsGrNkFPDazvQb8zoXWVNXTSX4EvAT4/uyiJEeAI9PNnyb59sU0PYJrWdebda+42r8xYM2VNtsdf87d6sKw2d7QkMDf6GymLmINVXUMOAaQZKWqlgbUH92ianeru8jaSVaGLNtg32U7211/zp3qPlP7Yv/ukJd01oA9M9u7gccvtCbJDuBFwA8vtilpmzjbamVI4D8I7E1yfZKrgUPA8ro1y8AfT2/fDvxrVZ13FiRdYpxttbLpSzrT1y3vAu4HrgI+WlWnktwDrFTVMvBPwCeSrDI5+zk0oPaxLfS9VYuq3a3uImtvWvcKnG1/zld+3S3VjicrktSDV9pKUhMGviQ1MffAX9Sl6wPqvivJ6SSPJPlikleMUXdI7Zl1tyepJKN8vGtI3SRvnj7uU0k+OUbdIbWTvDz
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 2 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"# Canevas vide de sous-graphiques 1 par 2\n",
|
||
|
"fig, axes = plt.subplots(nrows=1, ncols=2)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Tracer maintenant (x,y) et (x,z) sur les axes. Jouer avec la largeur et le style de la ligne**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 9,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD4CAYAAAANbUbJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deZhU5ZXH8e9BxIkroqAIKphgFBGJ9qgx7gsqScQlOihRFBJ0NBlwSURjxg1G4zJmiAKiMILiFlHBFZGYcSciEgRRQWOUHQVEoxHBM3+8t6jqohqqu27VreX3eZ5++t63ttPN7cOtW+95j7k7IiJS3ZolHYCIiBSfkr2ISA1QshcRqQFK9iIiNUDJXkSkBjRPOgCA7bff3jt06JB0GFLFXn/99Y/dvXWpX1fHthRTY47rskj2HTp0YNq0aUmHIVXMzP6exOvq2JZiasxxrcs4IiI1QMleqkbfvn1p06YNXbp0WTe2fPlyjjnmGIAuZjbZzLYFsGComc0zs5lmtm/qMWbWx8zmRl99Msb3M7M3o8cMNTMr4Y8nUhAle6kaZ599Nk8//XS9seuvv56jjjoKYBYwBRgU3XQ80Cn66g8MBzCzVsCVwAHA/sCVqf8govv0z3jccUX8cURitdFkb2Y7m9lzZjbHzGab2YBovFV0pjQ33zMmkWI69NBDadWqVb2xCRMm0KfPupPzMcCJ0XZPYKwHrwItzawtcCww2d2Xu/sKYDJwXHTb1u7+ioc1RsZmPJdI2cvnzH4NcLG77wkcCFxgZp0JZ0hT3L0TeZwxiSRhyZIltG3bFgB3XwS0iW5qB3yUcdf50diGxufnGF+PmfU3s2lmNm3ZsmVx/BgiBdtosnf3Re4+Pdr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JbofZtY5etxewHHAsFRdicgG/fOfMG5cev/kk0segpK9FE2uXrIJVska8K2o8ntzwtIeRxLqQQDGACdG2z2jfaLbj4oW/esJ3B9Viv8NmAfsX6L4pZI98gisWBG2O3YsWlPxDVGyl6IplyrZdu3aASwGPiQk+U+B14GV7r4mutt8oF3qIcBHANHtnwLbZY7neIxIw0aNSm/37ZvIH4KSvRRFrl6ySVXJrghnVC2BjsBOwBbA8Tnu6tF3a+C2hsbr0YquUs/f/gZTpoTtZs1KtjxCNiV7id3ChfDzn6f3k+4l++yzzwJ85e7L3P1r4GHgIKBldFkHoD2wMNqeD+wM6xb82wZYnjme4zHraEVXqWf06PT2scdC+/aJhKFkL7FKVckuj1ZEKocq2V122QVgSzPbPLr2fhTwFvAc8JPobn2ACdH2xGif6PY/ubtH472i2TodCQv9/aU0P4VUpDVr4H//N73/s58lFoqWS5BYlWOV7AEHHABhts10YA3wBjASeAK438wGR2OpC6ujgLvNbB7hjL4XgLvPNrMHCf9RrAEucPfST5iWyjFpEoTZYNCmDfz4x4mFomQvscmukr3oorKqkl3o7nVZY++TYzaNu/8TODXXk7j7EGBI/OFJVbrjjvT22WfDppsmFoou40gssqtk994bhiglSi375puwouUmUSlGv34bvn+R6cxeYpFdJTtunHrJSo1r1gweeijMWHjmGdg92aZ9OrOXgpVDlaxI2dppp8SmW2bKp1PVaDNbamazMsauMrMFZjYj+uqRcZvWDqkhZVYlKyINyOfM/i7COiDZbnH3btHXk6C1Q2pRuVTJipSVBFa13JiN/lm6+/OE6Wf50NohNUS9ZEVyWLQoFE5dcgm8+27S0axTyDnYL8xsZnSZZ9toLO+1Q1RSXtkWLarfS/b009VLVgQIFbOLF8PNN9cvJU9YU5P9cODbQDfCwlI3R+N5rR0CKimvZNm9ZNu3T75KVqQsrF0LI0em9zPPiBLWpGT
|
||
|
"text/plain": [
|
||
|
"<Figure size 432x288 with 2 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 9,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"axes[0].plot(x,y,color='b',lw=3,ls='-')\n",
|
||
|
"axes[1].plot(x,z,color='r',lw=3,ls='--')\n",
|
||
|
"\n",
|
||
|
"fig"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"**Voyez si vous pouvez redimensionner le tracé en ajoutant l'argument figsize() dans plt.subplots() et copier et coller votre code précédent.**"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 10,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"Text(0, 0.5, 'z')"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 10,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAtMAAACbCAYAAACgYBcZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de5xVdb3/8dcHBhIFFAURuTioeMtCcfIGxzDTRD2pqQQOgYZRKZmXh0fRU3m8JHkMozIVlbzMCHhNNJRIM+uYxMUESQsE1BHkruAFhOHz++O79m/2ZvYws++XeT8fj/WY2d+91p7vctFnf/qu72d9zd0REREREZHUtSl0B0RERERESpWSaRERERGRNCmZFhERERFJk5JpEREREZE0KZkWEREREUmTkmkRERERkTQpmRYRKUNmNtnMVpvZ63Fte5rZLDNbHP3sErWbmf3SzJaY2QIzGxB3zKho/8VmNiqu/SgzWxgd80szs/yeoYhIcbBcPWfazHoDDwL7ANuBSe4+0cz2BKYBlcByYKi7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y00fJD3f/BNhrh7Zv7WT/m4Gbk7TPAGZkvYMiUho++SQs933bbfDZZ6Ft9Gg45ZTC9ivPcvk0j+FJmu/byf5Jg7WIZCZWSFhbC/9M8aFlKiQUEZFG3OHJJ+HyyxOfGd2mTZjSoWRaREpdJisS9ugRkufqajjiiLJ4apGIiGTLv/4VpnTMmpXYfuyx8JvfwJFHFqZfBaRkWqRMZKOQcMQIrUgoIiJJbNw
|
||
|
"text/plain": [
|
||
|
"<Figure size 864x144 with 2 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {
|
||
|
"needs_background": "light"
|
||
|
},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"fig, axes = plt.subplots(nrows=1, ncols=2,figsize=(12,2))\n",
|
||
|
"\n",
|
||
|
"axes[0].plot(x,y,color=\"blue\", lw=5)\n",
|
||
|
"axes[0].set_xlabel('x')\n",
|
||
|
"axes[0].set_ylabel('y')\n",
|
||
|
"\n",
|
||
|
"axes[1].plot(x,z,color=\"red\", lw=3, ls='--')\n",
|
||
|
"axes[1].set_xlabel('x')\n",
|
||
|
"axes[1].set_ylabel('z')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Bon travail!"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"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.7.5"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 1
|
||
|
}
|