plotly / plotly/plotly.py

`plotly.express.imshow` blurry when exported to pdf

Open
#4,846 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

When writing plotly.express.imshow figure to pdf using write_image, the contents are rendered extremely blurry while axes and legends are rendered just fine: test.pdf

Code to produce figure:

import numpy as np
import plotly.express as px

np.random.seed(0)
data = np.random.randint(low=0, high=2, size=(10, 10))

fig = px.imshow(data)
fig.write_image('test.pdf', format='pdf')

I am using plotly version 5.24.1 and kaleido version 0.2.1.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided NumPy and plotly.express.imshow example, using fig.write_image('test.pdf', format='pdf') and the reported plotly and kaleido versions. Compare the exported image content with the axes and legends; done means the image is rendered sharply in the PDF without degrading the other elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
plotly, python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.