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

Unable to group or remove legend for multiple cf.subplots #258

Open
wyczolko opened this issue Dec 9, 2020 · 0 comments
Open

Unable to group or remove legend for multiple cf.subplots #258

wyczolko opened this issue Dec 9, 2020 · 0 comments

Comments

@wyczolko
Copy link

wyczolko commented Dec 9, 2020

I have a group of subplots all of the form:

fig5 = px.scatter(dashOut['BO'], x=dashOut['BO'].index, y='BO', color='Sign',
color_discrete_map={
-1: "red",
1: "blue",
},size='Mag',hover_data=['P_chg','VLM_chg','OI_chg'])
fig5.update(layout_coloraxis_showscale=False)
fig5.add_trace(go.Scatter(x=dashOut['BO'].index, y=dashOut['BO']['BO'],
mode='lines',
name='lines',showlegend=False))

And a combination thereof with cf.subplots:
py.plot(cf.subplots([fig,fig1,fig2,fig3,fig4,fig5],shape=(3,2),subplot_titles=("Corn OI/VOLUME/PRICE ACTION","Chi Wheat OI/VOLUME/PRICE ACTION","KC OI/VOLUME/PRICE ACTION",
"Soybeans OI/VOLUME/PRICE ACTION","Soymeal OI/VOLUME/PRICE ACTION","Beanoil OI/VOLUME/PRICE ACTION")),filename='tst3.html')

The charts are perfect as expected except I have 6 legend entries for each color. How do I group the entries so my legend will not replicate x the amount of charts in the subplot grouping...or at the very least how can I turn off the legend altogether. No traditional plotly configuration methods such as show_legend = False on update fig calls have worked.

Capture

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

1 participant