diff options
author | koray kavukcuoglu <koray@kavukcuoglu.org> | 2012-02-13 23:02:30 +0400 |
---|---|---|
committer | koray kavukcuoglu <koray@kavukcuoglu.org> | 2012-02-13 23:02:30 +0400 |
commit | 669518434ee0062cd1d3ae05b2453adc981ff97c (patch) | |
tree | 4560b463d6addd25efb1d3aec7e2393e07db7a57 | |
parent | c7dd0c13452d2913a063f053736d7214bccd11b9 (diff) |
fixed pretty print on histc
-rw-r--r-- | hist.lua | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -101,8 +101,8 @@ function gnuplot.histc(...) -- cleanup hist local cleanhist = {} cleanhist.raw = hist - local mx = torch.max(cleanhist.raw) - local mn = torch.min(cleanhist.raw) + local _,mx = torch.max(cleanhist.raw,1) + local _,mn = torch.min(cleanhist.raw,1) cleanhist.bins = bins cleanhist.binwidth = (max-min)/bins for i = 1,bins do @@ -110,8 +110,8 @@ function gnuplot.histc(...) cleanhist[i].val = min + (i-0.5)*cleanhist.binwidth cleanhist[i].nb = hist[i] end - cleanhist.max = mx - cleanhist.min = mn + cleanhist.max = mx[1] + cleanhist.min = mn[1] -- print function setmetatable(cleanhist, {__tostring=histc__tostring}) |