From 5e6a9da3ed5d6cd856ad499659b6a60eb2af8944 Mon Sep 17 00:00:00 2001 From: Josef Heinen Date: Mon, 8 May 2017 14:36:25 -0700 Subject: [PATCH] gr: use correct colorbar scaling --- src/backends/gr.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backends/gr.jl b/src/backends/gr.jl index c41c38ba..0566da5a 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -813,12 +813,12 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) isfinite(clims[1]) && (zmin = clims[1]) isfinite(clims[2]) && (zmax = clims[2]) end + GR.setspace(zmin, zmax, 0, 90) if typeof(series[:levels]) <: Array h = series[:levels] else h = linspace(zmin, zmax, series[:levels]) end - GR.setspace(zmin, zmax, 0, 90) if series[:fillrange] != nothing GR.surface(x, y, z, GR.OPTION_CELL_ARRAY) else @@ -856,6 +856,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) isfinite(clims[1]) && (zmin = clims[1]) isfinite(clims[2]) && (zmax = clims[2]) end + GR.setspace(zmin, zmax, 0, 90) grad = isa(series[:fillcolor], ColorGradient) ? series[:fillcolor] : cgrad() colors = [grad[clamp((zi-zmin) / (zmax-zmin), 0, 1)] for zi=z] rgba = map(c -> UInt32( round(Int, alpha(c) * 255) << 24 +