4834_lecture_16_ho

4834_lecture_16_ho - EEL 4834: Lecture 16 EEL 4834: Lecture...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EEL 4834: Lecture 16 EEL 4834: Lecture 16 Plotting with Matplotlib Professor O. Boykin University of Florida, Department of Electrical and Computer Engineering October 1, 2009 EEL 4834: Lecture 16 Matplotlib: Matlab-style plotting in Python http://matplotlib.sourceforge.net/ Matplotlib is a simple plotting library for Python. import matplotlib.pyplot as plt import numpy as np x = np.arange( 10.0, 10.0, 0.1) y = np.sin(x) plt.plot(x,y,label= sin(x) ) #put the label in a legend on the plot: plt.legend() plt.xlabel( x axis name ) plt.ylabel( y axis name ) plt.title( My awesome plot ) plt.show() EEL 4834: Lecture 16 There is a huge cookbook of different examples. Well just see a few simples ones. EEL 4834: Lecture 16 Practical Example I saw this news item on obesity: http://www.webmd.com/diet/ news/20090708/how-fat-is-your-state and also this one: http://www.webmd.com/food-recipes/ news/20090929/few-eating-enough-fruits-veggies And wondered if obesity and veggie consumption were related. EEL 4834: Lecture 16 Simple parsing So I copied and pasted the data from the web page into a file and used this to parse the data: import sys datafile = open(sys.argv[1]) state to veg = {}...
View Full Document

Page1 / 9

4834_lecture_16_ho - EEL 4834: Lecture 16 EEL 4834: Lecture...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online