Avoid string translated as date when plot scatter

Hi, you can force the axis type to be β€˜category’ as follows

import plotly.express as px
fig = px.scatter(x=['00-01', '01-02', '02-03'], y=[0, 1, 4,])
fig.update_layout(xaxis_type='category')
fig.show()

(plotly is interpreting strings formatted like dates as dates, but you can override this behaviour)

1 Like