Merge pull request #2364 from yha/heatmap-fillcolor

Fix heatmap with non-gradient fillcolor
This commit is contained in:
Michael Krabbe Borregaard 2020-01-22 19:51:10 +01:00 committed by GitHub
commit 73ff286162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1685,7 +1685,8 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
# pdf output, and also supports alpha values.
# Note that drawimage draws uniformly spaced data correctly
# even on log scales, where it is visually non-uniform.
colors = plot_color.(series[:fillcolor][z_normalized], series[:fillalpha])
fillgrad = _as_gradient(series[:fillcolor])
colors = plot_color.(fillgrad[z_normalized], series[:fillalpha])
colors[isnan.(z_normalized)] .= RGBA(0,0,0,0)
rgba = gr_color.(colors)
GR.drawimage(first(x), last(x), last(y), first(y), w, h, rgba)