I am using Plotly to plot actual versus predicted values from a dataset. Everything runs fine, except I would like to color actual value points (SalePrice) in blue and predicted value points (pred.price) in red. I'm relatively new to Plotly and have been playing around with some examples given online but it's not quite what I'm looking for. I have the following syntax below that plots all points in a singular color but I am not sure how to proceed. Thank you
avp.plot <- plot_ly(data = avp.df, x = ~SalePrice, y = ~pred.price, type = 'scatter')
avp.plot
The head of the df looks like this:
SalePrice pred.price
1 208500 206900.5
2 181500 175133.0
3 223500 216843.6
4 140000 216189.2
5 250000 281824.2
6 143000 135957.3
