Created
February 21, 2011 14:43
-
-
Save stucchio/837140 to your computer and use it in GitHub Desktop.
source code for graph in blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Created graph used here: http://crazybear.posterous.com/structural-shift-in-the-economy | |
import numpy.numarray as na | |
from pylab import * | |
labels = ["Financial Activites", | |
"Construction", | |
"Information Services", | |
"Retail", | |
"Durable Goods Manufacturing", | |
"Government", | |
"Education & Health", | |
"Goods-Producing Industries", | |
"Leisure and Hospitality", | |
"Professional & Business Services", | |
"Trade, Transportation & Utilities", | |
"Natural Resources/Mining", | |
"Other Services", | |
] | |
data = [1-8225/7606.0 , | |
1-7487/5455.0, | |
1-3024/2698.0, | |
1-15580.6/14471.3, | |
1-8702.0/7189.0, | |
1-22377.0/22235, | |
1 - 18555.0/19768.0, | |
1-21967.0/17804, | |
1-13538.0/13062, | |
1-18052.0/16929, | |
1-26731.0/24739, | |
1-740.0/732.0, | |
1-5514.0/5424, | |
] | |
ylocations = na.array(range(len(data)))+0.5 | |
width = 0.5 | |
barh(ylocations, data, height=width) | |
#yticks(range(0, 8)) | |
yticks(ylocations+ width/2, labels) | |
xlim(-0.4, 0.4) | |
title("Change in Employment, Dec 2007-Jan 2010") | |
gca().get_xaxis().tick_bottom() | |
gca().get_yaxis().tick_left() | |
axvline(0) | |
show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment