✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Fig.update_yaxes breaks fig.update_layout.title updates?

UPDATE: I may have pinned it down to transition_duration. If I don’t set this param in update_layout then the title updates as it should…

I have an app which makes a second graph with a new title when a first graph is clicked. This had been working nicely until I tried to set a fixed axis range with fig.update_xaxes() and fig.update_yaxes().

The title updates on the first click, but remains the same on subsequent clicks.

I’ve confirmed that the click-data is changing on each click. The annotations and shapes which also depend on the click data are also updating. Only the graph title is not updating. This is a bizarre bug (or user error) since I feel the plot is being completely remade every callback… Let me know if you need more information.

@app.callback(
    Output('graph2', 'figure'),
    # Input('graph1', 'clickData'),
    Input('graph1', 'clickData'))

def update_std(click):    
    fig_std = go.Figure()

    fig_std.add_trace(go.Scatter(
        x=moisture_x,
        y=moist,
        mode='lines+markers'
    ))

    fig_std.update_layout(transition_duration=300, hovermode='x unified',
    title=f"{str(click['points'][0]['x'])}")


    fig_std.update_xaxes(range=[0, 30])
    fig_std.update_yaxes(range=[0, 40])  # Statement which breaks title updates
    
    return fig_std