dataframe_image icon indicating copy to clipboard operation
dataframe_image copied to clipboard

Table snapshots are shrinking throughout the document

Open MDDietz1 opened this issue 3 years ago • 1 comments

Hi all, I am trying to pdf a Jupyter Notebook using "Download as" - "DataFrame as Image" then using the Latex option and Chrome for Screenshots. My document has tables of different width. The large tables are shrunk correctly to fit onto the page. However, it seems that the shrinkage factor isn't reset. So some "normal sized" tables towards the end of the document are shrunk to a fraction of their size.

Example attached. I would expect the first and third table to look identical, but the third table is half the size. It seems the shrinkage factor applied to table 2 is never being reset. In my actual document, the impact is actually much more severe,

The issue seems to be Chrome specific and Matplotlib does not seem to have the same issue. The shrinkage issue is also showing when saving the notebook with embedded images "_dataframe_image", but picture files when downloading as a Markdown file look OK.

image

MDDietz1 avatar Nov 17 '22 18:11 MDDietz1

My last comment was wrong... the png files that are created and included for the Markdown also have the wrong size. Picture 1 above is 980x94 while Picture 3 is 1470x94. So that is a factor of 1.5 as in https://github.com/dexplo/dataframe_image/blob/ff1fa4853c480cda1021229e009cdd6e0740c915/dataframe_image/_screenshot.py#L150

MDDietz1 avatar Nov 18 '22 10:11 MDDietz1