Do NOT include Images in HTML

Hi,

I want to save a Plotly.fig as HTML, but

Do NOT include Images in HTML

and remain as URL (local or web)

HOW TO DO IT, please?

Here an example

”# Create figure

fig = go.Figure()

pyLogo = Image.open(β€œaA_DEMO_04_pctA.png”)

# Add trace

fig.add_trace(

go.Scatter(x=\[0, 0.5, 1, 2, 2.2\], y=\[1.23, 2.5, 0.42, 3, 1\])

)

fig.add_layout_image(

    dict(

        source=pyLogo,

        xref="x",

        yref="y",

        x=0,

        y=3,

        sizex=2,

        sizey=2,

        sizing="stretch",

        opacity=0.5,

        layer="below")

)

…

fig.write_html(htmlfile, full_html=False, include_plotlyjs=β€˜cdn’)

fig.show()”

Best regards,

Ciprian

Hi @Dromihetex, If you haven’t found yet a solution for inserting an image as a background for a figure, and then saving the figure in HTML format, here is how to do it: https://gist.github.com/empet/207955438b4f0c3c7599f9ff367fd0c2