File:US Trade Balance 1980 2014.svg

This file has been superseded by US Trade Balance from 1960.svg. It is recommended to use the other file. Please note that deleting superseded images requires consent.
new file
Category:Superseded

Summary

Description
English: United States Balance of Trade, 1980–2014. Data Source: US Census Bureau Foreign Trade Division: https://www.census.gov/foreign-trade/statistics/historical/gands.txt
Date
Source Own work
Author Morn
SVG development
InfoField
Source code
InfoField

Python code

Source code
from pylab import *

style.use("ggplot")	# requires Matplotlib 1.5.1 or later
 
# From https://www.census.gov/foreign-trade/statistics/historical/gands.txt (1960-2014):

t = """   3,508
   4,195
   3,370
   4,210
   6,022
   4,664
   2,939
   2,604
     250
      91
   2,254
  -1,302
  -5,443
   1,900
  -4,293
  12,404
  -6,082
 -27,246
 -29,763
 -24,565
 -19,407
 -16,172
 -24,156
 -57,767
-109,072
-121,880
-138,538
-151,684
-114,566
 -93,141
 -80,864
 -31,135
 -39,212
 -70,311
 -98,493
 -96,384
-104,065
-108,273
-166,140
-258,617
-372,517
-361,511
-418,955
-493,890
-609,883
-714,245
-761,716
-705,375
-708,726
-383,774
-494,658
-548,625
-536,773
-478,394
-508,324"""

d = []
for l in t.splitlines():
	d.append(float(l.replace(',', ''))/1000)
 
start, end = 1980, 2014
y = range(start, end + 1)
skip = start - 1960

f = figure(figsize = (7.5, 4.5))
ax = f.add_axes((.13, .18, .8, .75))
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
plot(y, d[skip:], '-', lw = 2.5)
plot(y, d[skip:], 'o', ms = 5)

xlabel('Year')
ylabel('Billions USD')
title('U.S. Trade Balance (%u%u)' % (start, end))
 
text(end, -950, 'Data Source: US Census Bureau Foreign Trade Division',
  va = 'bottom', ha = 'right' , size = 10)
 
axis((start, end, -800, 0))
savefig("US Trade Balance %u %u.svg" % (start, end))
 
show()

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-3.0#US%20Trade%20Balance%201980%202014.svg
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
Category:License migration redundant#US%20Trade%20Balance%201980%202014.svgCategory:GFDL#US%20Trade%20Balance%201980%202014.svg
You may select the license of your choice.
Category:Self-published work Category:Balance of trade#USA,%20Trade%20Balance Category:Economic statistics#USA,%20Trade%20Balance Category:Economic statistics for the United States#Trade%20Balance,%201980–2014 Category:Time series line charts#USA,%20Trade%20Balance Category:Images with Python source code Category:SVG created with Matplotlib
Category:Balance of trade Category:CC-BY-SA-3.0 Category:Economic statistics Category:Economic statistics for the United States Category:GFDL Category:Images with Python source code Category:License migration redundant Category:SVG created with Matplotlib Category:Self-published work Category:Superseded Category:Time series line charts Category:Valid SVG created with Matplotlib code