I figured out the issue. It was that I was using lists for my x
and y
values for the dummy trace I was adding. By converting them to an np.array
the problem was solved.
new_fig.add_trace(go.Scatter(x=np.array([0]), y=np.array([0]), name='Name', legendgroup='Group Name')
Making the above change made the trace behave properly. Earlier it was taking on values from a previously plotted trace. Not sure why exactly.
I can create a functional minimal repeatable example if someone wants to dig in more detail.