dataframe_image icon indicating copy to clipboard operation
dataframe_image copied to clipboard

table_conversion='matplotlib' and set_table_styles

Open florentcomte opened this issue 1 year ago • 4 comments

Hi,

I created a table with a style and I tried to export in png with the conversion = 'matplotlib'. Unfortunately, I do not see the style in my png.

Thank you for your help.

Here is my code:

import dataframe_image as dfi
import pandas as pd
import numpy as np

col_headers = {
    "selector": ".col_heading, thead",
    "props": "color: white; background-color: #1d5632; \
            font-size: 11px"
    }

        
df = pd.DataFrame(np.random.rand(6, 4))
df_styled = df.style.set_table_styles(styles)
dfi.export(df_styled, 'df_styled.png', table_conversion='matplotlib')

Exported png: df_styled

df_styled in Jupyter: Capture d’écran 2023-10-25 à 12 59 15

florentcomte avatar Oct 25 '23 11:10 florentcomte

Confirmed, dealing.

PaleNeutron avatar Oct 26 '23 00:10 PaleNeutron

I have a similar issue, the effect of style.bar is not showing up in the image.

df_fmt = df.style.bar(subset=['Prob(%)'], color=["green","red"], align="zero") dfi.export(df_fmt, pngfile, table_conversion='matplotlib')

lip99-TW avatar Nov 23 '23 15:11 lip99-TW

Bump on this issue... love the package/super cool and useful

I am creating a table with pretty_html_table package and same as posters above its losing all table style properties upon exporting:

desired:

Screenshot 2024-02-15 at 6 19 05 AM

actual:

Screenshot 2024-02-15 at 6 19 31 AM

omes11 avatar Feb 15 '24 12:02 omes11