GR heatmap: warning for non-equal spacing

This commit is contained in:
yha 2018-06-16 03:13:13 +03:00
parent dc31cd7103
commit 00483d4c0d

View File

@ -719,7 +719,10 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
if st == :heatmap if st == :heatmap
outside_ticks = true outside_ticks = true
for ax in (sp[:xaxis], sp[:yaxis]) for ax in (sp[:xaxis], sp[:yaxis])
ax[:scale] != :identity && warn("GR: heatmap with $(ax[:scale]) scale not supported.") v = series[ax[:letter]]
if diff(collect(extrema(diff(v))))[1] > 1e-6*std(v)
warn("GR: heatmap only supported with equally spaced data.")
end
end end
x, y = heatmap_edges(series[:x], sp[:xaxis][:scale]), heatmap_edges(series[:y], sp[:yaxis][:scale]) x, y = heatmap_edges(series[:x], sp[:xaxis][:scale]), heatmap_edges(series[:y], sp[:yaxis][:scale])
xy_lims = x[1], x[end], y[1], y[end] xy_lims = x[1], x[end], y[1], y[end]