Mathematica绘制美元对人民币走势图
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
startdate = "12/31/1980"; enddate = DateString[{"Month", "/", "Day", "/", "Year"}]; fxdownload = Import@StringJoin[ "http://www.federalreserve.gov/datadownload/Output.aspx?rel=H10&\ series=356f2a973bbb516442c693dc19615b69&lastObs=&from=", startdate, "&to=", enddate, "&filetype=csv&label=include&layout=seriescolumn"]; fxdata = Drop[fxdownload, 6]; datelistfx = Cases[fxdata, {_, _?NumberQ}]; datelistfx[[All, 1]] = Join[ToExpression@StringSplit[#, "-"], {0, 0, 0.}] & /@ datelistfx[[All, 1]]; DateListPlot[datelistfx, Joined -> True, PlotLabel -> StringJoin["Daily CNY/USD from ", DateString[datelistfx[[1, 1]], {"Day", "/", "Month", "/", "Year"}], " to ", DateString[ datelistfx[[-1, 1]], {"Day", "/", "Month", "/", "Year"}]]] |