• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
10

Bug: matplotlib saved images are not displayed properly in Acrobat Reader

New Here ,
May 18, 2024 May 18, 2024

Copy link to clipboard

Copied

This is a bug about displaying images generated using matplotlib in Python. In a very specific scenario, where the linewidth is 0, linestyle is not solid and marker is not None, the saved images are not displayed properly in Acrobat Reader. Sometimes, there will also be a message pop-up saying "An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem". After changing the linewidth from 0 to some finite number and changing linestyle from "dashed" to "none", the problem is gone.

 

Since the images are displayed properly in Chrome or Edge, I suspect that this is a problem of Acrobat reader. The reason this occurs could be because Acrobat reader is trying to display lines that are infinitely thin and something goes wrong when doing calculation of the spacing of the dashes on the line.

 

To reproduce the bug, run the following code in Python.

import matplotlib.pyplot as plt
plt.plot([0, 1], lw=0, ls="dashed", marker="o")
plt.savefig("image.pdf")

 

I am using Windows 10, python 3.9.10, matplotlib 3.5.1, Adobe Acrobat Reader 2024.002.20759. I also tested this on macOS Sonoma 14.4.1, python 3.9.18, matplotlib 3.5.1, Adobe Acrobat Reader 2024.002.20687 and get the same result.

 

Expected result (screenshot taken from Chrome):

chrome.PNG

 

Observed result (screenshot taken from Acrobat):

acrobat.PNG

 

This is a very minor bug, though.

TOPICS
General troubleshooting , Mac , View PDF , Windows

Views

74

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 03, 2024 Jun 03, 2024

Copy link to clipboard

Copied

LATEST

Hi tszfungk26740715,

 

Thank you for reaching out, and sorry about the delayed response.

 

It seems to be a file-specific issue. Does this happen with other files or with a particular file?

Please share the file with us so we can check it. Share the Acrobat Reader and OS version used.

We will replicate the behavior for further investigation. 

 

Thanks

Meenakshi

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines