I’m having a difficulty trying to return subplots in a callback function. I have made a scatter plot in the function
scatter_plot = px.scatter( data_frame=dff, x=x, y=y, color='make', )
And output it to a Div
html.Div(children=[ dcc.Graph(id='scatter-plot') ]),
In the function, if I just do
return scatter_plot, it works perfectly fine. But as soon as I create a subplots and append the scatter plot and returning it, I get an error message about “Invalid element(s) received for the ‘data’ property…”
fig = make_subplots(rows=1, cols=1) fig.append_trace(scatter_plot, 1, 1) return fig
Any advice would be appreciated!