Adding Custom Labels to Scatter Plots

Is there a way to add an additional label that isn’t included in the plot itself?

Given the code below I’m adjusting the labels that I’m using to build the scatter plot.

    fig = px.scatter(
        df,
        x="TestTime",
        y="CorrectedLoad",
        color="SoftwareVersion",
        trendline="lowess",
        range_x=[start_date, end_date],
        title=f"{DUTModel} | Acceptable Frame Loss 0.5% | 1000 Flows BiDi",
        template="ggplot2",
        labels={
            "CorrectedLoad": "Throughput (Mbps)",
            "TestTime": "Test Timestamp",
            "SoftwareVersion": "Software Version",
        },
    )

However, each data point has some additional attribute (df[“tags”]) that I would like to expose on the tooltip popup even though plotly isn’t using them to generate the graph.

1 Like