JuliaPlots / JuliaPlots/PlotlyJS.jl

heatmap docs not consistent with API

Open
#340 0 comments 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**
The example for heatmaps in the docs cannot be reproduced using a fresh `Plotly.js` install
**Version info**

Please provide the following:

1. output of julia command `versioninfo()`
```
Julia Version 1.4.2
Commit 44fa15b150* (2020-05-23 18:35 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, icelake-client)
Environment:
JULIA_EDITOR = "/opt/visual-studio-code/code"
JULIA_NUM_THREADS = 6
```

2. Output running the following in Julia 0.7 or greater: `using Pkg; pkg"status"`
```
Status `~/.julia/environments/v1.4/Project.toml`
[6e4b80f9] BenchmarkTools v0.5.0
[336ed68f] CSV v0.6.2
[13f3f980] CairoMakie v0.3.1
[324d7699] CategoricalArrays v0.8.1
[aa819f21] CompatHelper v1.13.3
[a93c6f00] DataFrames v0.21.6
[31c24e10] Distributions v0.23.4
[5789e2e9] FileIO v1.4.0
[f7f18e0c] GLFW v3.2.2
[e9467ef8] GLMakie v0.1.9
[c91e804a] Gadfly v1.3.0
[9bc6ac9d] GeneticVariation v0.4.0
[7073ff75] IJulia v1.21.2
[033835bb] JLD2 v0.1.14
[ee78f7c6] Makie v0.11.1
[e1d29d7a] Missings v0.4.3 #master (https://github.com/JuliaData/Missings.jl.git)
[f8716d33] MultipleTesting v0.4.1
[b98c9c47] Pipe v1.3.0
[14b8a8f1] PkgTemplates v0.7.7
[f0f68f2c] PlotlyJS v0.13.1
[af524d12] PopGen v0.0.3
[33c8b6b6] ProgressLogging v0.1.3
[92933f4c] ProgressMeter v1.3.2
[1a8c2f83] Query v0.12.2
[612083be] Queryverse v0.6.1
[ce6b1742] RDatasets v0.6.9
[295af30f] Revise v2.7.3
[2913bbd2] StatsBase v0.33.0
[65254759] StatsMakie v0.2.3
[fce5fe82] Turing v0.13.0 #master (https://github.com/TuringLang/Turing.jl.git)
[112f6efa] VegaLite v2.3.0
[9a3f8284] Random
```

The examples in the docs:
```julia
function heatmap1()
plot(heatmap(z=[1 20 30; 20 1 60; 30 60 1]))
end

julia> heatmap1()
ERROR: LoadError: MethodError: no method matching heatmap(; z=[1 20 30; 20 1 60; 30 60 1])
Closest candidates are:
heatmap(::DataFrame) at Untitled-1:2 got unsupported keyword argument "z"
Stacktrace:
[1] heatmap1() at ./Untitled-1:22
[2] top-level scope at Untitled-1:24
[3] include_string(::Module, ::String, ::String) at ./loading.jl:1080
in expression starting at Untitled-1:24
```
```julia
function heatmap2()
trace = heatmap(
x=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
y=["Morning", "Afternoon", "Evening"],
z=rand(1:30, 5, 3)
)
plot(trace)
end

julia> heatmap2()
ERROR: LoadError: MethodError: no method matching heatmap(; x=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], y=["Morning", "Afternoon", "Evening"], z=[25 12 21; 8 4 8; … ; 12 15 23; 28 29 10])
Closest candidates are:
heatmap(::DataFrame) at Untitled-1:2 got unsupported keyword arguments "x", "y", "z"
Stacktrace:
[1] heatmap2() at ./Untitled-1:12
[2] top-level scope at Untitled-1:19
[3] include_string(::Module, ::String, ::String) at ./loading.jl:1080
in expression starting at Untitled-1:19
```

Further, there is no docstring available when invoking `?heatmap`

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.