JuliaPlots / JuliaPlots/PlotlyJS.jl

`heatmap` flips rows/columns

Open
#80 3 comments 0 reactions 0 assignees View on GitHub
api help wanted
Dominant language
Julia
Stars
444
Forks
86
PR merge metrics
No merged PRs in 30d

Description

The `heatmap` plot type is useful for visualizing a matrix, but the cells are all transposed relative to how matrices are represented at the REPL. Additionally it is flipped so that index (1, 1) is at the bottom-left.

For Example:

``` julia
plot(heatmap(z=reshape(1:12, 3, 4)))
```

Shows this:
![screen shot 2016-10-04 at 4 49 36 pm](https://cloud.githubusercontent.com/assets/734386/19091972/bace5b06-8a52-11e6-9625-24030787b7d6.png)

The plotly.js docs don't seem to specify whether they expect row-major or column-major 2D arrays, but empirically they treat them as row-major. JSON.jl renders 2D matrices as column-major. It's always a tough call to decide when it's worth adding extra processing between PlotlyJS.jl and plotly.js, but in this case the behavior seems to be something of an implementation detail that it would be OK to change.

I'm a little more torn on the origin location (bottom-left vs. top-left) as that's a user-visible change that would make it behave differently than plotly.js.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.