Plotly Scatter Plot Text as HTML/CSS

@allsyntax,

The problem isnt that they arent showing up, the problem is that they are too small due to the massive scale of the x axis!

import plotly.express as px
import datetime
df = px.data.stocks()
from pprint import pprint

fig = px.scatter(df, y='GOOG', x='date', title='Population of European continent')
for i, r in df.iterrows():
    fig.add_layout_image(
        dict(
            source="https://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Iris_setosa_var._setosa_%282595031014%29.jpg/360px-Iris_setosa_var._setosa_%282595031014%29.jpg",
            xref="x",
            yref="y",
            x=r['date'],
            y=r['GOOG'],
            sizex=604800*3000,
            sizey=0.1,
            xanchor="center",
            yanchor="middle",
            opacity=0.8,
            layer="above"
        )
    )

fig.show()

resulted in this:

1 Like