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()
import plotly.graph_objects as go
fig = go.Figure(go.Scatter(
y = [4, 1, 3],
x = ["December", "January", "February"]))
# set x axis label
fig.update_xaxes(
title_text = "Month", # label
title_font = {"size": 20},
title_standoff = 25)
# set y axis label
fig.update_yaxes(
title_text = "Temperature", # label
title_standoff = 25)
fig.show()