heliosdrm / GRUtils.jl

Tools for using the GR framework in Julia
Other
31 stars 6 forks source link

`heatmap` displaying confusing output and accepts strange inputs #75

Closed kapple19 closed 3 years ago

kapple19 commented 3 years ago

The following code

julia> x = 1:0.5:10;  y = 1:0.25:5; z = x'.*y;

julia> using GRUtils

julia> heatmap(x, y, z)

yields the following heatmap

image

and appending the code with

julia> z = x.*y'

julia> heatmap(x, y, z)

yields the following heatmap

image

I have a few questions:

  1. I know the right way is the first way (z = x'.*y), but why does heatmap accept z = x.*y' as well, when it's a different size array?
  2. Why is there a diagonal discontinuity?

Even scarier, heatmap accepts completely inconsistent sizes.

julia> heatmap([1, 2, 3, 4], [5, 6, 7, 8, 9, 10], [1 2; 3 4])

image

Is the heatmap just still a WIP? Or is there some rationale behind this functionality?

heliosdrm commented 3 years ago

No, it may be considered a bug. Thanks for reporting.