Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
429 views
in Technique[技术] by (71.8m points)

python - plotly go cutting off the labels on x axis

I am trying to plot something using plotly go and my x axis labels are too long so plotly is cutting them off and they are not visible completely.

I am using the following code:

    fig = go.Figure()
    for i in df_int.columns[1:]:
        fig.add_trace(go.Scatter(x=df_int['index'],y=df_int[i],mode='markers'
       ,cliponaxis=False,name=i,visible= 'legendonly'))
    fig.show()

The length of each index that I am trying to visualize on x axis is very long upto 100 characters so it is getting trimmed. when I plot the same using matplotlib it is plotting correctly.

1)Is there a way I could resolve this and be able to visualize the labels completely?

2)Also is it possible to replace these labels with integers on x axis?

I am new to plotly so not sure how I can resolve this. Please help.

question from:https://stackoverflow.com/questions/65840094/plotly-go-cutting-off-the-labels-on-x-axis

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...