    "# QUESTION 6: Plot your results! \n",
    "fig = plt.figure()\n",
    "# In the next three lines, change 'ekin' to ekin.to(some unit), etc. to make readable plots \n",
    "plt.plot(theta_rad,ekin,color='red',label='E_kin') \n",
    "plt.plot(theta_rad,epot,color='blue',label='E_pot') \n",
    "plt.plot(theta_rad,e_tot,color='black',label='E_tot')\n",
    "plt.xlabel('1o') # Add label\n",
    "plt.ylabel(''0) # Add label\n",
    "plt.legend(frameon=False)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Using functions to explore how r and v vary with orbital parameters\n",
    "\n",
    "In python, once you start writing longer and more complicated programs, it is useful to create your own functions that you can then call in your code. Functions can be used for calculations that you might do many times, or to simplify a very long block of code. Remember you always have to run the function definition before you can run it in the code. This can be done by including your functions near the beginning of your notebook. Here, we will just define the function in the same block as running it. \n",
    "\n",
    "You create a function with a line starting 'def' , followed by your function name, brackets containing the parameters you need to give that function for it to do its work, followed by a colon. This tells python that everything underneath and indented (the indent is important!) that those lines are part of the function. \n",
    "\n",
    "We will just create a simple function here that returns two arrays, $r$ and $v$, but if you want to learn more one good tutorial is [here](http://introtopython.org/introducing_functions.html). "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-73-4131ea4d0246>, line 5)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-73-4131ea4d0246>\"\u001b[0;36m, line \u001b[0;32m5\u001b[0m\n\u001b[0;31m    r =\u001b[0m\n\u001b[0m        ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
