How to manually set the labels of the points in a plotly?
library(ggplot2)
library(plotly)
p <- iris %>%
ggplot(aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point() +
labs(
title = "A graph",
x = "Sepal Length (cm)",
y = "Sepal Width (cm)",
color = "Species of Iris"
)
ggplotly(p)
The axis are correctly labelled, but the data is not.

Here is an example of how it works in Python
https://plotly.com/python/figure-labels/
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_length", y="sepal_width", color="species",
labels={
"sepal_length": "Sepal Length (cm)",
"sepal_width": "Sepal Width (cm)",
"species": "Species of Iris"
},
title="Manually Specified Labels")
fig.show()
