JuliaPlots / JuliaPlots/PlotlyJS.jl

cannot create subplots of pie

Open
#468 2 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**
I have such code
```julia
using StatsBase, PlotlyJS, DataFrames
let nums = rand(1:10, 100)
cm = countmap(nums)
xs = collect(keys(cm))
ys = collect(values(cm))

df = DataFrame(xs = xs, ys = ys)

p = PlotlyJS.pie(df, values = :ys, textposition = "inside")

sp = make_subplots(rows = 1, cols = 2)
add_trace!(sp, p, row = 1, col = 1)
add_trace!(sp, p, row = 1, col = 2)
sp
end
```

what I expect is that there are two pie plots in the figure,
however there is only one pie plot

![image](https://github.com/JuliaPlots/PlotlyJS.jl/assets/46296608/9f58c9d5-7835-4ca0-acbe-567dbf1bc007)

**Version info**

Please provide the following:

1. output of julia command `versioninfo()`
```
Julia Version 1.9.1
Commit 147bdf428cd (2023-06-07 08:27 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, tigerlake)
Threads: 5 on 8 virtual cores
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS =
JULIA_PKG_SERVER = https://mirrors.bfsu.edu.cn/julia
```
2. Output running the following in Julia 0.7 or greater: `using Pkg; pkg"status"` (if you are on Julia 0.6 or earlier run `Pkg.status()`)
```
[aaaa29a8] Clustering v0.15.3
[a81c6b42] Compose v0.9.5
[a93c6f00] DataFrames v1.5.0
[0c46a032] DifferentialEquations v7.8.0
[a2cc645c] GraphPlot v0.5.2
[86223c79] Graphs v1.8.0
[87dc4568] HiGHS v1.5.2
[b6b21f68] Ipopt v1.4.1
[4076af6c] JuMP v1.12.0
[54119dfa] MLJXGBoostInterface v0.3.8
⌅ [961ee093] ModelingToolkit v8.59.1
[f0f68f2c] PlotlyJS v0.18.10
[91a5bcdd] Plots v1.38.16
[c3e4b0f8] Pluto v0.19.26
[78aadeae] SymbolicNumericIntegration v1.1.0
[0c5d862f] Symbolics v5.5.0
[009559a3] XGBoost v2.3.0
[fdbf4ff8] XLSX v0.9.0
[e88e6eb3] Zygote v0.6.62
```

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.