2017-06-17 50 views
0

我在使用pyplot时因图例调整图大小问题。这是代码:与传说密谋图问题

random_x = df['column1'] 
random_y = df['column2'] 


random_x1 = df['column1'] 
random_y1 = df['column3'] 

trace = go.Scatter(
    x = random_x, 
    y = random_y, 
    name='abcdefghijklmnop......' 
) 

trace1 = go.Scatter(
    x = random_x1, 
    y = random_y1, 
    name='abcdefghijklmnopadfdsfsdff......' 
) 

data = [trace,trace1] 

iplot(data, filename='basic-line') 

它给了我图,但由于我的图例字符很长,它减少了我的实际图形的大小。我希望传说要么来到底部,要么走到顶端

回答

0
layout = go.Layout(
       legend=dict(
       orientation="h") 
       )  
figure=go.Figure(data=data, layout=layout) 

iplot(figure,filename='basic-line')