Skip to content

Commit

Permalink
make the plot_statistics script a bit more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
stokasto committed Nov 29, 2014
1 parent b7a6053 commit 7071e2e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tools/plot_statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,18 @@ if parsed_args["idx"] != ""

figure()
for ind in selected_ind
(stats_num, fname, key) = numbered_names[ind]
# get the right stats file
(stats_num, fname, selected) = numbered_names[ind]
stats = all_stats[stats_num]

N = length(stats)
x = zeros(N)
y = zeros(N)
for (i, iter) in enumerate(sort(collect(keys(stats))))
x[i] = iter
y[i] = stats[iter][key]
end
plot(x, y, label="$(fname)/$(key)")
# do the actual plotting
# x will simply be the iteration number
# which we will sort
x = sort(collect(keys(stats)))
# and y is the statistics corresponding to
# the selected statistics you want to plot
y = [stats[i][selected] for i in x]
plot(x, y, label="$(fname)/$(selected)")
end
legend()

Expand Down

0 comments on commit 7071e2e

Please sign in to comment.