我需要在真實數(shù)組和預測數(shù)組之間生成誤差圖。我已經(jīng)設法用 來做到這一點plotly,如中所示Code 1,但是生成的圖在頂部有太多空間。如果我按下autoscale圖中的按鈕 - 它會修復它。代碼 1:import numpy as npimport plotly.graph_objects as goN = 40y1 = np.random.randint(0, 2, N)y2 = np.random.randint(0, 2, N)err = np.where(y1 != y2)[0]fig = go.Figure()fig.add_trace( go.Scatter( x=err, y=np.zeros_like(err), name='Prediction Errors', mode='markers', marker_symbol='x', marker_color='red', showlegend=True ))fig.update_layout(title_text = 'Errors in activity prediction', height=10)fig.update_xaxes(title_text = 'User index', range=[-0.3, N])fig.update_yaxes(range=[-0.01, 0.1], visible=False)產(chǎn)生的圖像:期望的輸出:我的問題:autoscale它可以自動完成嗎(即不需要我每次都按下按鈕)?提前致謝。
添加回答
舉報
0/150
提交
取消