1

I'm trying to live plot some data and the sidebar is getting pushed to the right too much because of the figure dimensions. What's the proper way to control that gap? enter image description here

My code:

app = dash.Dash(__name__)
app.layout = html.Div(
    [
        dash.dcc.Graph(id='live-graph'),
        dash.dcc.Interval(id='time', interval=250),
    ],
        style={"display": "inline-block"}
)

@app.callback(Output('live-graph', 'figure'),
          [
              Input('time', 'n_intervals')
    ]
)
def update(t):
    if t is None:
        return dash.no_update
    
    fig = go.Figure(data={'data':
                  [
                      go.Scatter3d(...),
                      go.Scatter3d(...)
            ]
        }
    )
    fig.update_layout(uirevision='constant',
                      scene_camera=camera,
                      width=2000,
                      height=2000,
                      margin=dict(l=20, r=0, t=20, b=20, pad=0),
                      scene=dict(xaxis=dict(range=[-10, 10]), yaxis=dict(range=[-10, 10]), zaxis=dict(range=[0, 3])))
    return fig
Leo
  • 101
  • 7

0 Answers0