JuliaPlots / JuliaPlots/PlotlyJS.jl

Incorrect bar chart rendering with DataFrames

Open
#282 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
444
Forks
86
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When using two different DataFrames to plot into a bar chart as two different traces, the resultant bar chart does not show what I would expect; the bars are horizontal instead of vertical, and they do not show the proper numerical values.

**Version info**

```
julia> versioninfo()
Julia Version 1.2.0-rc1.0
Commit 7097799cf1 (2019-05-30 02:22 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.6.0)
CPU: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
```

```
(test_data) pkg> status
Status `~/src/SpeedCenter.jl/test_data/Project.toml`
[a93c6f00] DataFrames v0.18.3
[41391dba] InfluxDB v0.1.0 [`~/.julia/dev/InfluxDB`]
[47be7bcc] ORCA v0.2.1
[f0f68f2c] PlotlyJS v0.12.4

```

**MWE**:

```julia
using DataFrames, ORCA, PlotlyJS

df_slow = DataFrame(:conv2d => 2.5, :conv3d => 3.8, :gitsha => "1a2b3c4d")
df_fast = DataFrame(:conv2d => 0.2, :conv3d => 0.8, :gitsha => "5a6b7c8d")

slow_trace = bar(;x=[:conv2d, :conv3d], y=df_slow, name="v0.4.3")
fast_trace = bar(;x=[:conv2d, :conv3d], y=df_fast, name="master")

layout = Layout(;barmode="group")
p = Plot([slow_trace, fast_trace], layout)
PlotlyJS.savehtml(p, "comparison.html")
PlotlyJS.savefig(p, "comparison.png")
```

**Output**:

![comparison](https://user-images.githubusercontent.com/130920/58697880-08837a00-834f-11e9-9147-b359a4c09584.png)

I must be doing something silly, but I can't figure out what it is. :(

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.