{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
Dr. Joshua Vaughan
\n",
"joshua.vaughan@louisiana.edu
\n",
"http://www.ucs.louisiana.edu/~jev9637/
\n",
" \n",
" Figure 1: A Tiny Motor\n",
" \n",
"We can also generate plots inline. To do this we issue the command:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Plotting\n",
"We will use the [matplotlib](http://matplotlib.org) library for all our plotting. It's a powerful package and with a few tweaks to the defaults, we can generate nice-looking, easily-readable figures. \n",
"\n",
"Some great tutorials on the features of matplotlib can be found at:\n",
"* http://www.labri.fr/perso/nrougier/teaching/matplotlib/\n",
"* http://matplotlib.org/users/pyplot_tutorial.html"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# We want to show the figures inline\n",
"%matplotlib inline\n",
"\n",
"# Import the plotting functions \n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, let's try a simple plot."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"t = np.linspace(0, 5, 1000) # Define the time vector (start,end,number of points)\n",
"y = np.sin(2 * np.pi * t) \n",
"y2 = np.sin(4 * np.pi * t)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Licenses\n",
"Code is licensed under a 3-clause BSD style license. See the licenses/LICENSE.md file.\n",
"\n",
"Other content is provided under a [Creative Commons Attribution-NonCommercial 4.0 International License](http://creativecommons.org/licenses/by-nc/4.0/), CC-BY-NC 4.0."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"\n"
],
"text/plain": [
"