JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
413 stars 77 forks source link

Files saved with savefig not display Legend Group Titles #456

Open Straehlc opened 1 year ago

Straehlc commented 1 year ago

Describe the bug When saving a plot which contains legend groups and legend group titles, the legend group title go missing in the output file depending on file type. PNG and PDF have no legend group titles, while the HTML retains those. While saving a PNG from the html does work and the legend group titles are visible. Code I used: ` using PlotlyJS

p = Plot() add_trace!(p,scatter(x=1:100,y=rand(100),name="1",legendgroup="group",legendgrouptitle_text="First Group")) add_trace!(p,scatter(x=1:100,y=rand(100),name="1",legendgroup="group")) add_trace!(p,scatter(x=1:100,y=rand(100),name="1",legendgroup="group2",legendgrouptitle_text="Second Group"))

savefig(p,"test.html") savefig(p,"test.png") `

Version info On Windows 10 Please provide the following:

  1. output of julia command versioninfo()

Julia Version 1.8.2 Commit 36034abf26 (2022-09-29 15:21 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: 8 × Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-13.0.1 (ORCJIT, skylake) Threads: 1 on 8 virtual cores Environment: JULIA_EDITOR = code JULIA_NUM_THREADS =

  1. 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())

    [336ed68f] CSV v0.10.7 [a93c6f00] DataFrames v1.4.4 [7a1cc6ca] FFTW v1.5.0 [38e38edf] GLM v1.8.1 [7073ff75] IJulia v1.23.3 [23992714] MAT v0.10.3 [f0f68f2c] PlotlyJS v0.18.10 [91a5bcdd] Plots v1.36.6 [92933f4c] ProgressMeter v1.7.2 [5bab7191] SPICE v0.2.3

Directly save to PNG using savefig: failed Saved from html: from_html

pawbz commented 1 year ago

It would be nice if this could be resolved. Facing the same issue. The legendgrouptitle_text is replaced with Aa before saving as e.g., PDF.

qdddddd commented 1 year ago

Same issue here saving as SVG.