gr: fixed colorbar problem for flipped axes

This commit is contained in:
Josef Heinen 2017-10-10 10:54:29 +02:00
parent 7d220f571d
commit cc201ce4e7

View File

@ -458,6 +458,7 @@ function gr_colorbar(sp::Subplot, clims)
gr_set_viewport_cmap(sp) gr_set_viewport_cmap(sp)
l = zeros(Int32, 1, 256) l = zeros(Int32, 1, 256)
l[1,:] = Int[round(Int, _i) for _i in linspace(1000, 1255, 256)] l[1,:] = Int[round(Int, _i) for _i in linspace(1000, 1255, 256)]
GR.setscale(0)
GR.setwindow(xmin, xmax, clims[1], clims[2]) GR.setwindow(xmin, xmax, clims[1], clims[2])
GR.cellarray(xmin, xmax, clims[2], clims[1], 1, length(l), l) GR.cellarray(xmin, xmax, clims[2], clims[1], 1, length(l), l)
ztick = 0.5 * GR.tick(clims[1], clims[2]) ztick = 0.5 * GR.tick(clims[1], clims[2])