Scatter Plot X-Value Text Direction

I have a data set where the XValues are text (batch id’s) rather than numeric or date.
How do I set the direction of the text to be vertical rather than horizontal?

Hi @BigSJD,

welcome to the Plotly-community!
to rotate the text on the x-axis, set the value of the “tickangle” key to 90. See example below

import plotly.graph_objects as go


fig_layout = dict(
    xaxis={
        "tickangle" : 90
    }
)

fig_data = [
        go.Scatter(
            x=["111111", "222222", "333333","444444", "555555"],
            y=[4, 6, 1, 11, 5],
        )
    ]

fig = go.Figure(
    data=fig_data,
    layout=fig_layout
)


fig.show()
1 Like

Thank you Bakira.

This works perfectly.