JuliaPlots / PlotlyKaleido.jl

MIT License
17 stars 5 forks source link

Size cannot be adjusted. #19

Closed elgar328 closed 6 months ago

elgar328 commented 6 months ago

When I create a figure using PlotlyLight, the HTML version scales well with my settings, but the size of the images saved with PlotlyKaleido does not.

using PlotlyLight
using PlotlyKaleido

p = plot(y=rand(10))

p.layout.autosize = false
p.layout.width = 1000
p.layout.height = 300

PlotlyLight.save(p, "myplot.html")

PlotlyKaleido.start()
(;data, layout, config) = p
PlotlyKaleido.savefig((; data, layout, config), "myplot.png")
PlotlyKaleido.kill_kaleido()

myplot.html

스크린샷 2024-05-29 오전 7 20 21

myplot.png myplot

elgar328 commented 6 months ago

It works well. It was my mistake.

using PlotlyLight
using PlotlyKaleido

p = plot(y=rand(10))

PlotlyLight.save(p, "myplot.html")

PlotlyKaleido.start()
(;data, layout, config) = p
PlotlyKaleido.savefig((; data, layout, config), "myplot.png", height=300, width=1000)
PlotlyKaleido.kill_kaleido()