{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!DOCTYPE html>\n",
    "<html>\n",
    "<body>\n",
    "<div align=\"center\">\n",
    "<h3>Prepared by Asif Bhat</h3>\n",
    "    \n",
    "<h1>Data Visualization With Matplotlib</h1>\n",
    "\n",
    "<h3>Follow Me on - <a href=\"https://www.linkedin.com/in/asif-bhat/\">LinkedIn</a>&nbsp; <a href=\"https://mobile.twitter.com/_asifbhat_\">Twitter</a>&nbsp; <a href=\"https://www.instagram.com/datasciencescoop/?hl=en\">Instagram</a>&nbsp; <a href=\"https://www.facebook.com/datasciencescoop/\">Facebook</a></h3>\n",
    "</div>\n",
    "\n",
    "</div>\n",
    "</body>\n",
    "</html>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib as mpl\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Graph Styling\n",
    "# https://tonysyu.github.io/raw_content/matplotlib-style-gallery/gallery.html\n",
    "plt.style.use('seaborn-darkgrid')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Line Graphs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 10860 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# By default Plot() function will draw a line chart.\n",
    "x = np.array([1,2,3,4,5,6])\n",
    "y = np.power(x,3)\n",
    "plt.plot(x,y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 20752 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.linspace(0, 10, 1000) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Recover default matplotlib settings\n",
    "mpl.rcParams.update(mpl.rcParamsDefault)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 34028 characters]\n",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.linspace(0, 10, 1000) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.style.use('seaborn-darkgrid')\n",
    "%matplotlib inline "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 25572 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(10,5))\n",
    "x = np.linspace(0, 10, 1000) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 25712 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Solid blue line will be plotted using the argument \"b-\"\n",
    "plt.figure(figsize=(10,5))\n",
    "x = np.linspace(0, 10, 1000) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y,'b-')\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 26740 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Solid red line will be plotted using the argument \"r-\"\n",
    "plt.figure(figsize=(10,5))\n",
    "x = np.linspace(0, 10, 1000) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y,'r-')\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 12504 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot green dots using the argument \"go\"\n",
    "plt.figure(figsize=(10,5))\n",
    "x = np.linspace(0, 10, 40) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y,'go')\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 12544 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plotting red dots using the argument \"ro\"\n",
    "plt.figure(figsize=(10,5))\n",
    "x = np.linspace(0, 10, 40) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y,'ro')\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 12032 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plotting traingular dots using the argument \"r^\"\n",
    "plt.figure(figsize=(10,5))\n",
    "x = np.linspace(0, 10, 40) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y,'r^')\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 12304 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plotting traingular dots using the argument \"rv\"\n",
    "plt.figure(figsize=(10,5))\n",
    "x = np.linspace(0, 10, 40) \n",
    "y = np.sin(x) # Sine Graph\n",
    "plt.plot(x,y,'rv')\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 20772 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Plotting multiple sets of data\n",
    "plt.figure(figsize=(10,5))\n",
    "x = np.array([1,2,3,4,5,6])\n",
    "y1 = np.power(x,2)\n",
    "y2 = np.power(x,3)\n",
    "plt.plot(x,y1, \"b-\" , label = '$y1 = x^2$') # Setting up legends \n",
    "plt.plot(x,y2, \"r-\" ,label ='$y2 = x^3$')   # Setting up legends\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.legend()\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 50768 characters]\n",
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Plotting multiple sets of data\n",
    "x = np.linspace(0, 10, 2000)  \n",
    "plt.figure(figsize=(10,6))\n",
    "plt.plot(x,np.sin(x) , label = '$Sin(X)$')\n",
    "plt.plot(x,np.cos(x) , label = '$cos(X)$')\n",
    "plt.xlabel(r'$X$' , fontsize = 18)\n",
    "plt.ylabel(r'$Y$' , fontsize = 18)\n",
    "plt.title(\"$Sin(x) $  $ & $  $ Cos(x)$\" ,fontsize = 14)\n",
    "plt.legend(loc = 'upper right') # Legend will be placed at upper right position\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 18208 characters]\n",
      "text/plain": [
       "<Figure size 720x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Changing the line style\n",
    "plt.figure(figsize=(10,5))\n",
    "x = np.array([1,2,3,4,5,6])\n",
    "y1 = np.power(x,2)\n",
    "y2 = np.power(x,3)\n",
    "plt.plot(x,y1, \"b-\" , label = '$y1 = x^2$') # Setting up legends \n",
    "plt.plot(x, y2,color='red',linewidth=1.0,linestyle='--')   # Setting up legends\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.legend(loc='upper center', fontsize='large')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 125988 characters]\n",
      "text/plain": [
       "<Figure size 1152x648 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Line Styling\n",
    "x = np.linspace(0, 10, 2000)  \n",
    "plt.figure(figsize=(16, 9))\n",
    "plt.plot(x,np.sin(x) , label = '$Sin(X) $  $ Dashed $' , linestyle='dashed')\n",
    "plt.plot(x+1,np.sin(x) , label = '$Sin(X) $  $ Dashdot  $' , linestyle='dashdot')\n",
    "plt.plot(x,np.cos(x) , label = '$cos(X) $ $ Solid $' , linestyle='solid')\n",
    "plt.plot(x+1,np.cos(x) , label = '$cos(X)$ $ Dotted $' , linestyle='dotted')\n",
    "plt.xlabel(r'$X$' , fontsize = 18)\n",
    "plt.ylabel(r'$Y$' , fontsize = 18)\n",
    "plt.title(\"$Sin(x) $  $ & $  $ Cos(x)$\" ,fontsize = 14)\n",
    "plt.legend(loc = 'upper right' , fontsize = 14 , bbox_to_anchor=(1.2, 1.0)) # Legend will be placed at upper right position\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 125988 characters]\n",
      "text/plain": [
       "<Figure size 1152x648 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Line Styling\n",
    "x = np.linspace(0, 10, 2000)  \n",
    "plt.figure(figsize=(16, 9))\n",
    "plt.plot(x,np.sin(x) , label = '$Sin(X) $  $ Dashed $' , linestyle='--')\n",
    "plt.plot(x+1,np.sin(x) , label = '$Sin(X) $  $ Dashdot  $' , linestyle='-.')\n",
    "plt.plot(x,np.cos(x) , label = '$cos(X) $ $ Solid $' , linestyle='-')\n",
    "plt.plot(x+1,np.cos(x) , label = '$cos(X)$ $ Dotted $' , linestyle=':')\n",
    "plt.xlabel(r'$X$' , fontsize = 18)\n",
    "plt.ylabel(r'$Y$' , fontsize = 18)\n",
    "plt.title(\"$Sin(x) $  $ & $  $ Cos(x)$\" ,fontsize = 14)\n",
    "plt.legend(loc = 'upper right' , fontsize = 14 , bbox_to_anchor=(1.2, 1.0)) # Legend will be placed at upper right position\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 40356 characters]\n",
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Shading Regions with fill_between() function\n",
    "x = np.linspace(0, 10, 2000)  \n",
    "plt.figure(figsize=(10,6))\n",
    "plt.plot(x,np.sin(x) , label = '$Sin(X)$')\n",
    "plt.plot(x,np.cos(x) , label = '$cos(X)$')\n",
    "plt.fill_between(x,0,np.sin(x))\n",
    "plt.fill_between(x,0,np.cos(x))\n",
    "plt.xlabel(r'$X$' , fontsize = 18)\n",
    "plt.ylabel(r'$Y$' , fontsize = 18)\n",
    "plt.title(\"$Sin(x) $  $ & $  $ Cos(x)$\" ,fontsize = 14)\n",
    "plt.legend(loc = 'lower left') # Legend will be placed at lower left position\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 15340 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Changing Legend position & font\n",
    "x = np.array([1,2,3,4,5,6])\n",
    "y1 = np.power(x,2)\n",
    "y2 = np.power(x,3)\n",
    "plt.plot(x,y1, \"b-\" , label = '$y1 = x^2$') # Setting up legends \n",
    "plt.plot(x,y2, \"r-\" ,label ='$y2 = x^3$')   # Setting up legends\n",
    "plt.xlabel(\"X - Axis\")\n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.legend(loc='upper center', fontsize='large')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 23252 characters]\n",
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Changing line width\n",
    "plt.figure(figsize=(10,6))\n",
    "x= [1,2,3,4,5,6,7,8,9] \n",
    "y= [7,8,9,10,7,11,12,13,14]\n",
    "y2 = [7,7,7,7,7,7,7,7,7]\n",
    "plt.plot(x , y, linewidth = 4 ,label = 'Line -1')  # Changing line width\n",
    "plt.plot(x , y2, linewidth = 3,label = 'Line - 2')\n",
    "plt.xlabel('X Axis Label')\n",
    "plt.ylabel('Y Axis Label')\n",
    "plt.title ('Line Graph')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 23384 characters]\n",
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot with Grid Lines\n",
    "plt.figure(figsize=(10,6))\n",
    "x= [1,2,3,4,5,6,7,8,9] \n",
    "y= [7,8,9,10,7,11,12,13,14]\n",
    "y2 = [7,7,7,7,7,7,7,7,7]\n",
    "plt.plot(x , y, linewidth = 4 ,label = 'Line -1')  # Changing line width\n",
    "plt.plot(x , y2, linewidth = 3,label = 'Line - 2')\n",
    "plt.xlabel('X Axis Label')\n",
    "plt.ylabel('Y Axis Label')\n",
    "plt.title ('Line Graph')\n",
    "plt.legend()\n",
    "plt.grid(b=True , linestyle = '-' , which = 'major' , color = 'grey') # Grid Lines\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 20460 characters]\n",
      "text/plain": [
       "<Figure size 864x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Setting the background color\n",
    "x = np.array([1,2,3,4,5,6])\n",
    "y1 = np.power(x,2)\n",
    "y2 = np.power(x,3)\n",
    "plt.figure(figsize=(12,5)) # Setting the figure size\n",
    "ax = plt.axes()\n",
    "ax.set_facecolor(\"darkgrey\") # Setting the background color by using Hex code\n",
    "plt.plot(x,y1,\"bo-\", x,y2, \"ro-\")\n",
    "plt.xlabel(\"X - Axis\") \n",
    "plt.ylabel(\"Y - Axis\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 42208 characters]\n",
      "text/plain": [
       "<Figure size 1008x432 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Display multiple plots in one figure (1 row & 2 columns)\n",
    "plt.figure(figsize=(14,6))\n",
    "x = np.linspace(0, 10, 100) \n",
    "y1 = np.sin(x) # Sine Graph\n",
    "y2 = np.cos(x) # cosine graph\n",
    "plt.subplot(1,2,1)\n",
    "plt.plot(x,y1)\n",
    "plt.subplot(1,2,2)\n",
    "plt.plot(x,y2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 49212 characters]\n",
      "text/plain": [
       "<Figure size 864x432 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Display multiple plots in one figure (2 row & 1 columns)\n",
    "\n",
    "plt.figure(figsize=(12,6))\n",
    "x = np.linspace(0, 10, 100) \n",
    "y1 = np.sin(x) # Sine Graph\n",
    "y2 = np.cos(x) # cosine graph\n",
    "\n",
    "plt.subplot(2,1,1)\n",
    "plt.plot(x,y1, \"b-\")\n",
    "\n",
    "plt.subplot(2,1,2)\n",
    "plt.plot(x,y2, \"r-\")\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 201708 characters]\n",
      "text/plain": [
       "<Figure size 1440x1440 with 9 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# # Display multiple plots in one figure using subplots()\n",
    "x = np.arange(-50,50)\n",
    "y1 = np.power(x,2)\n",
    "y2 = np.power(x,3)\n",
    "y3 = np.sin(x)\n",
    "y4 = np.cos(x)\n",
    "y5 = np.tan(x)\n",
    "y6 = np.tanh(x)\n",
    "y7 = np.sinh(x)\n",
    "y8 = np.cosh(x)\n",
    "y9 = np.exp(x)\n",
    "\n",
    "fig1 , ax1 = plt.subplots(nrows=3,ncols=3 , figsize = (20,20)) # Create a figure and subplots\n",
    "ax1[0,0].plot(x,y1,\"tab:blue\") # set the color of the line chart\n",
    "ax1[0,0].set_title(\"Square Function\") # setting title of subplot\n",
    "ax1[0,0].set_xlabel(r'$X$' , fontsize = 18) #Set the label for the x-axis\n",
    "ax1[0,0].set_ylabel(r'$Y$' , fontsize = 18) #Set the label for the y-axis\n",
    "\n",
    "\n",
    "ax1[0,1].plot(x,y2,\"tab:orange\")\n",
    "ax1[0,1].set_title(\"Cubic Function\")\n",
    "ax1[0,1].set_xlabel(r'$X$' , fontsize = 18)\n",
    "ax1[0,1].set_ylabel(r'$Y$' , fontsize = 18)\n",
    "\n",
    "ax1[0,2].plot(x,y3,\"tab:green\")\n",
    "ax1[0,2].set_title(\"Sine Function\")\n",
    "ax1[0,2].set_xlabel(r'$X$' , fontsize = 18)\n",
    "ax1[0,2].set_ylabel(r'$Y$' , fontsize = 18)\n",
    "\n",
    "\n",
    "ax1[1,0].plot(x,y4,\"b-\")\n",
    "ax1[1,0].set_title(\"Cosine Function\")\n",
    "ax1[1,0].set_xlabel(r'$X$' , fontsize = 18)\n",
    "ax1[1,0].set_ylabel(r'$Y$' , fontsize = 18)\n",
    "\n",
    "\n",
    "ax1[1,1].plot(x,y5,\"r-\")\n",
    "ax1[1,1].set_title(\"Tangent Function\")\n",
    "ax1[1,1].set_xlabel(r'$X$' , fontsize = 18)\n",
    "ax1[1,1].set_ylabel(r'$Y$' , fontsize = 18)\n",
    "\n",
    "ax1[1,2].plot(x,y6,\"g-\")\n",
    "ax1[1,2].set_title(\"Hyperbolic Tangent\")\n",
    "ax1[1,2].set_xlabel(r'$X$' , fontsize = 18)\n",
    "ax1[1,2].set_ylabel(r'$Y$' , fontsize = 18)\n",
    "\n",
    "ax1[2,0].plot(x,y7,\"m-\")\n",
    "ax1[2,0].set_title(\"Hyperbolic Sine\")\n",
    "ax1[2,0].set_xlabel(r'$X$' , fontsize = 18)\n",
    "ax1[2,0].set_ylabel(r'$Y$' , fontsize = 18)\n",
    "\n",
    "ax1[2,1].plot(x,y8,\"y-\")\n",
    "ax1[2,1].set_title(\"Hyperbolic Cosine\")\n",
    "ax1[2,1].set_xlabel(r'$X$' , fontsize = 18)\n",
    "ax1[2,1].set_ylabel(r'$Y$' , fontsize = 18)\n",
    "\n",
    "ax1[2,2].plot(x,y9,\"k-\")\n",
    "ax1[2,2].set_title(\"Exponential Function\")\n",
    "ax1[2,2].set_xlabel(r'$X$' , fontsize = 18)\n",
    "ax1[2,2].set_ylabel(r'$Y$' , fontsize = 18)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iteration Number :- 1\n",
      "X1 Value :- [10, 20, 30, 40, 50]\n",
      "Y value (i) :- [1, 2, 3, 4, 5]\n",
      "iteration Number :- 2\n",
      "X1 Value :- [10, 20, 30, 40, 50]\n",
      "Y value (i) :- [10, 20, 30, 40, 50]\n",
      "iteration Number :- 3\n",
      "X1 Value :- [10, 20, 30, 40, 50]\n",
      "Y value (i) :- [60, 70, 80, 90, 100]\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 20012 characters]\n",
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "y = [[1,2,3,4,5] , [10,20,30,40,50],[60,70,80,90,100] ]\n",
    "cnt =0\n",
    "plt.figure(figsize=(10,6))\n",
    "for i in y:\n",
    "    x1 = [10,20,30,40,50]\n",
    "    cnt +=1\n",
    "    print ('iteration Number :- {}'.format(cnt))\n",
    "    print ('X1 Value :- {}'.format(x1))\n",
    "    print('Y value (i) :- {}'.format(i))\n",
    "    plt.plot(x1,i)\n",
    "plt.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.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
