0

Here is an image:

enter image description here

I want to plot three error graphs with predicted vs actual values in one plot, scatter plots. I couldn't figure out how to do that with plotly.express, but I figured it out with graph_objects library of plotly. But now I want to add a traceline for each individual data set, and annotations with the r^2 value and the mean absolute error.

I found how to add tracelines in plotly.expresss but not in plotly.graph_objects :sweat_smile. Anyone have any suggestions?

    f3 = go.Figure(
        data = [
            go.Scatter(x=errors_doge_df['Day 1 percent test'], y=errors_doge_df['Day 1 percent predicted'],mode='markers', name="Day 2"),
            go.Scatter(x=errors_doge_df['Day 2 percent test'], y=errors_doge_df['Day 2 percent predicted'],mode='markers', name="Day 3"),
            go.Scatter(x=errors_doge_df['Day 3 percent test'], y=errors_doge_df['Day 3 percent predicted'],mode='markers', name="Day 4"),
    ],
        layout = {"xaxis": {"title": "Test Percentage Change Data"}, "yaxis": {"title": "Predicted Percentage Change Data"}, "title": "Doge Prediction Error Graph"}
)
    f3.show()
toyota Supra
  • 3,181
  • 4
  • 15
  • 19
TamE
  • 1
  • 1

1 Answers1

0

You were using mode='markers', if you want to plot lines instead of points, use mode='lines' instead of mode='markers'. Or you could use mode='lines+markers' for both

plot graph objects

AnhPC03
  • 622
  • 5
  • 15