From: <dil...@us...> - 2013-06-29 19:48:26
|
Revision: 6210 http://sourceforge.net/p/freeorion/code/6210 Author: dilvish-fo Date: 2013-06-29 19:48:21 +0000 (Sat, 29 Jun 2013) Log Message: ----------- modified charting script to show cumulative production over period Modified Paths: -------------- trunk/FreeOrion/default/AI/charting/charts.py Modified: trunk/FreeOrion/default/AI/charting/charts.py =================================================================== --- trunk/FreeOrion/default/AI/charting/charts.py 2013-06-28 02:53:10 UTC (rev 6209) +++ trunk/FreeOrion/default/AI/charting/charts.py 2013-06-29 19:48:21 UTC (rev 6210) @@ -155,15 +155,16 @@ else: if playerName in empireColors: turnsP = allData[playerName].get("turnsP", []) + thisData = allData.get(playerName, {}).get(plotType, []) print "plotting with color for player: ", playerName, "data min/max: ", min(allData[playerName].get(plotType, [])), ' | ', max(allData[playerName].get(plotType, [])) - plot(turnsP, allData[playerName].get(plotType, []), 'o-', color=empireColors[playerName], label=playerName, linewidth=2.0) + plot(turnsP, thisData, 'o-', color=empireColors[playerName], label="%s - %.1f"%(playerName, sum(thisData)), linewidth=2.0) else: print "plotting withOUT color for player: ", playerName, "data min/max: ", min(allData[playerName].get(plotType, [])), ' | ', max(allData[playerName].get(plotType, [])) plot(turnsP, allData[playerName].get(plotType, []), 'bx-', label=playerName, linewidth=2.0) for rank,name in rankings[::-1]: if name in empireColors: adata = allData[name].get(plotType, []) - plot(range(turns[0], turns[0]+len(adata)), adata, color=empireColors[name], label=name+" : "+species[name], linewidth=2.0) + plot(range(turns[0], turns[0]+len(adata)), adata, color=empireColors[name], label="%s: %s - %.1f"%(name, species[name], sum(adata)), linewidth=2.0) else: print "can't find empire color for ", name #plot(range(turns[0], turns[0]+len(allData[name])), allData[name].get(plotType, []), label="(%d) "%(empires.index(name)+1)+name+" : "+species[name], linewidth=2.0) |