Fix heatmap with non-gradient fillcolor

This commit is contained in:
yha 2020-01-20 17:53:47 +02:00
parent 33d04c3e6b
commit c75f6f5a9d

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)