plotly / Kaleido

Fast static image export for web-based visualization libraries with zero dependencies
Other
363 stars 36 forks source link

Poor quality (Plotly) image export in container #147

Open McPonolith opened 1 year ago

McPonolith commented 1 year ago

Hi,

Im attempting to make the plotly image export match as close as possible to the interactive chart. One issue Im running into is when running the following python script on my Macbook I am getting an image more representative to the interactive plot than when I run into within the container. Considering Kaleido explicitly states it just works in containers (Ive also tried ubuntu:latest), I feel like there is some missing instructions in the documentation as to how to make the container image look like the Macbook image, potentially and missing dependency, or system config?

Macbook

plot_macos

Container

plot_container

Notice the large marker size, there are others but this it the most identifiable Reproducible scripts have been attached.

FROM python:3.7.12
WORKDIR /app
RUN pip install plotly kaleido
CMD python ./scatter3d.py
from plotly.io import write_image, kaleido
write_image(plot, './plot.png', width=1300, height=350)
print('done')
docker compose up --build

large_marker_issue.zip

gvwilson commented 2 months ago

Thanks for your interest in Kaleido. We are currently working on an overhaul that might address your issue - we hope to have news in a few weeks and will post an update then. Thanks - @gvwilson