fix nonuniform heatmap in GR

This commit is contained in:
Daniel Schwabeneder 2020-04-16 21:34:30 +02:00
parent ba4f2665e0
commit 3078a44fce
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ Measures = "0.3"
NaNMath = "0.3"
PGFPlotsX = "1.2.0"
PlotThemes = "2"
PlotUtils = "0.7"
PlotUtils = "1"
RecipesBase = "1"
RecipesPipeline = "0.1.3"
Reexport = "0.2"

View File

@ -1668,7 +1668,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
@warn "GR: transparency not supported in non-uniform heatmaps. Alpha values ignored."
end
colors = get(fillgrad, z, clims)
z_normalized = map(c -> c == invisible() ? 256/255 : getinverse(fillgrad, c), colors)
z_normalized = map(c -> c == invisible() ? 256/255 : PlotUtils.getinverse(fillgrad, c), colors)
rgba = Int32[round(Int32, 1000 + _i * 255) for _i in z_normalized]
GR.nonuniformcellarray(x, y, w, h, rgba)
end
@ -1685,7 +1685,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
@warn "Right now only the maximum value of y (r) is taken into account."
end
colors = get(fillgrad, z, clims)
z_normalized = map(c -> c == invisible() ? 256/255 : getinverse(fillgrad.colors, c), colors)
z_normalized = map(c -> c == invisible() ? 256/255 : PlotUtils.getinverse(fillgrad.colors, c), colors)
rgba = Int32[round(Int32, 1000 + _i * 255) for _i in z_normalized]
# GR.polarcellarray(0, 0, phimin, phimax, ymin, ymax, nx, ny, colors)
GR.polarcellarray(0, 0, phimin, phimax, 0, ymax, nx, ny, rgba)