Open StefanPofahl opened 1 year ago
Without your lines of code that generated the above error, it's difficult to say what was wrong . add_trace!
accepts legendrank
:
fig2 = make_subplots(rows=1, cols=2)
add_trace!(fig2, scatter(name="first", x=[1,2,3], y=rand(3), legendrank=1), row=1, col=1)
add_trace!(fig2, bar(name="second", x=["a", "b"], y=[2,1.3], legendrank=3), row=1, col=2)
add_trace!(fig2, bar(name="third", x=["a", "b"], y=[1,1.5], legendrank=2), row=1, col=2)
relayout!(fig2, width=650, height=300)
display(fig2)
and addtraces!
, as well:
fig1 = Plot([bar(name="second", x=["a", "b"], y=[2,1], legendrank=2),
bar(name="third", x=["a", "b"], y=[1,2], legendrank=3)],
Layout(width=550, height=350))
addtraces!(fig1, bar(name="first", x=["a", "b"], y=[1.5, 3], legendrank=1))
display(fig1)
Thanks for your help!
My fault was, that I tried to give the parameter legendrank
as an input for the function addtraces!()
.
I oversaw the 2nd closing bracket in the revated python example:
https://plotly.com/python/legend/
Is it planned that
add_trace!()
can support the parameter:legendrank
?error: