dataframe_image icon indicating copy to clipboard operation
dataframe_image copied to clipboard

Superscript text not exported properly

Open moyscode opened this issue 3 years ago • 6 comments

I have a data-frame with some Superscript text crate with the code [cm\N{SUPERSCRIPT THREE}/min] . grafik

However when i export this df as a image with the code below.

import dataframe_image as dfi
dfi.export(styled_df, "resultTable.png"))

It does not get exported properly (pic below). There a weird straight line like character instead of Superscript grafik

Is there workaround for this?

moyscode avatar Jun 07 '22 07:06 moyscode

Can you create the superscript without latex? How about using the unicode superscript ³

tdpetrou avatar Jun 07 '22 13:06 tdpetrou

I did that too with [cm\u00b3/min] instead of [cm\N{SUPERSCRIPT THREE}/min]. Even with this approach, the table looks correct in Jupyter notebook but after saving it as .png with dataframe_image, the same weird straight line like character is there instead of Superscript.

moyscode avatar Jun 08 '22 06:06 moyscode

Can you use the literal character ³ instead of the unicode?

tdpetrou avatar Jun 08 '22 13:06 tdpetrou

Same result even with character ³. The same weird straight line like character is there instead of Superscript in the exported .png file.

moyscode avatar Jun 09 '22 04:06 moyscode

Any fix or workaround for this issue?

moyscode avatar Jul 14 '22 10:07 moyscode

Any fix or workaround for this issue?

moyscode avatar Jul 27 '22 14:07 moyscode

converters = ["chrome", "selenium", "matplotlib", "html2image", "playwright"]
for c in converters:
    df_latex = pd.DataFrame(["cm³/mm²"])
    dfi.export(
        df_latex,
        f"c.png",
        table_conversion=c,
    )

Following 5 images are test result. I can not reproduce the bug.

test_superscript chrome test_superscript playwright test_superscript html2image test_superscript matplotlib test_superscript selenium

PaleNeutron avatar Sep 01 '23 07:09 PaleNeutron