Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_trace!() not compatible to parameter legendrank #449

Open
StefanPofahl opened this issue Oct 21, 2022 · 2 comments
Open

add_trace!() not compatible to parameter legendrank #449

StefanPofahl opened this issue Oct 21, 2022 · 2 comments

Comments

@StefanPofahl
Copy link

Is it planned that add_trace!() can support the parameter: legendrank?

error:

 got unsupported keyword argument "legendrank"
@empet
Copy link

empet commented Oct 21, 2022

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)

add_trace_legendrank

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)

addtraces_legendrank

@StefanPofahl
Copy link
Author

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants