Created
August 24, 2011 19:43
-
-
Save theY4Kman/1168998 to your computer and use it in GitHub Desktop.
<Trading Game> Mechanical Turk Graphs Generator
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
def graphs(results): | |
for user,res in results.items(): | |
clf() | |
axes([.075,.05, .725,.9]) | |
xlabel('Time') | |
ylabel('Cash Value') | |
title('Results for %s' % user) | |
plot(res[0], res[1], label='Cash in Wallet') | |
plot(res[0], res[2], label='Inventory Value') | |
plot(res[0], res[3], label='Net Worth') | |
legend(loc=[1.0,0.6]) | |
savefig('graphs/user_%s.png' % user) | |
for label,idx in (('Cash in Wallet', 1), ('Inventory Value', 2), ('Net Worth', 3)): | |
clf() | |
axes([.075,.05, .725,.9]) | |
xlabel('Time') | |
ylabel('Cash Value') | |
title('Combined %s' % label) | |
for user,res in results.items(): | |
plot(res[0], res[idx], label=user) | |
legend(loc=[1.0,0.6]) | |
savefig('graphs/Combined %s.png' % label) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment