gr hist2d fix; closes #253

This commit is contained in:
Thomas Breloff 2016-05-27 09:05:48 -04:00
parent 34a7f8a99c
commit 314053af54

View File

@ -929,8 +929,9 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
xbins = ybins = d[:bins]
end
x, y, H = Base.hist2d(E, xbins, ybins)
counts = round(Int32, 1000 + 255 * H / maximum(H))
n, m = size(counts)
maxh = maximum(H)
n, m = size(H)
counts = Int32[round(Int32, 1000 + 255 * H[n-i+1,j] / maxh) for i=1:n,j=1:m]
GR.cellarray(xmin, xmax, ymin, ymax, n, m, counts)
# NOTE: set viewport to the colorbar area, get character height, draw it, then reset viewport