Merge pull request #951 from jheinen/master
gr: implemented "old" heatmap behaviour
This commit is contained in:
commit
d9890498d1
@ -544,6 +544,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
viewport_plotarea[:] = gr_viewport_from_bbox(sp, plotarea(sp), w, h, viewport_canvas)
|
viewport_plotarea[:] = gr_viewport_from_bbox(sp, plotarea(sp), w, h, viewport_canvas)
|
||||||
# get data limits
|
# get data limits
|
||||||
data_lims = gr_xy_axislims(sp)
|
data_lims = gr_xy_axislims(sp)
|
||||||
|
xy_lims = data_lims
|
||||||
|
|
||||||
ratio = sp[:aspect_ratio]
|
ratio = sp[:aspect_ratio]
|
||||||
if ratio != :none
|
if ratio != :none
|
||||||
@ -586,6 +587,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
if st == :heatmap
|
if st == :heatmap
|
||||||
outside_ticks = true
|
outside_ticks = true
|
||||||
x, y = heatmap_edges(series[:x]), heatmap_edges(series[:y])
|
x, y = heatmap_edges(series[:x]), heatmap_edges(series[:y])
|
||||||
|
xy_lims = x[1], x[end], y[1], y[end]
|
||||||
expand_extrema!(sp[:xaxis], x)
|
expand_extrema!(sp[:xaxis], x)
|
||||||
expand_extrema!(sp[:yaxis], y)
|
expand_extrema!(sp[:yaxis], y)
|
||||||
data_lims = gr_xy_axislims(sp)
|
data_lims = gr_xy_axislims(sp)
|
||||||
@ -873,7 +875,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
cmap && gr_colorbar(sp)
|
cmap && gr_colorbar(sp)
|
||||||
|
|
||||||
elseif st == :heatmap
|
elseif st == :heatmap
|
||||||
xmin, xmax, ymin, ymax = data_lims
|
xmin, xmax, ymin, ymax = xy_lims
|
||||||
zmin, zmax = gr_lims(zaxis, true)
|
zmin, zmax = gr_lims(zaxis, true)
|
||||||
clims = sp[:clims]
|
clims = sp[:clims]
|
||||||
if is_2tuple(clims)
|
if is_2tuple(clims)
|
||||||
@ -888,10 +890,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
|
|||||||
round(Int, green(c) * 255) << 8 +
|
round(Int, green(c) * 255) << 8 +
|
||||||
round(Int, red(c) * 255) ), colors)
|
round(Int, red(c) * 255) ), colors)
|
||||||
w, h = length(x), length(y)
|
w, h = length(x), length(y)
|
||||||
GR.drawimage(xmin - 0.5 * (xmax - xmin) / (w - 1),
|
GR.drawimage(xmin, xmax, ymax, ymin, w, h, rgba)
|
||||||
xmax + 0.5 * (xmax - xmin) / (w - 1),
|
|
||||||
ymax + 0.5 * (ymax - ymin) / (h - 1),
|
|
||||||
ymin - 0.5 * (ymax - ymin) / (h - 1), w, h, rgba)
|
|
||||||
cmap && gr_colorbar(sp)
|
cmap && gr_colorbar(sp)
|
||||||
|
|
||||||
elseif st in (:path3d, :scatter3d)
|
elseif st in (:path3d, :scatter3d)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user