question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple legends: trace.legend and layout.legend<N>

See original GitHub issue

Breaking off of https://github.com/plotly/plotly.js/issues/1668

Multiple users have requested what amounts to the ability to have multiple legends, within the current concept of “each trace has a single legend item which appears in a single legend”. This could be implemented by adding a legend attribute to each trace that would operate similarly to the xaxis attribute, and a corresponding legend2, legend3 series of attributes in the layout. This is distinct from the idea of having a legend for size and one for symbol etc, as in that case each item would refer to multiple traces, and each trace would be represented by multiple items.

The major challenge here is the default positioning of legend2 if present… we could do something really ugly like just having it default to the position of the first legend and forcing users to position them manually, but having it “stick to the bottom” is probably a much more graceful solution, if more complex to implement.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:25
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nicolaskruchtencommented, Aug 23, 2021

We’re still looking for a sponsor, and will update this issue when we find one 😃

2reactions
nicolaskruchtencommented, Sep 11, 2020

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

Sponsorship range: $10k-$15k

What Sponsorship includes:

  • Completion of this feature to the Sponsor’s satisfaction, in a manner coherent with the rest of the Plotly.js library and API
  • Tests for this feature
  • Long-term support (continued support of this feature in the latest version of Plotly.js)
  • Documentation at plotly.com/javascript
  • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
  • Possibility of integrating this feature with Dash
  • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
  • Gratification of advancing the world’s most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

Please include the link to this issue when contacting us to discuss.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Legends in Python - Plotly
Traces of most types can be optionally associated with a single legend item in the legend. Whether or not a given trace appears...
Read more >
How can I put different legends to subplots in plotly?
I notice though that the legend 2 can not have the traces hidden or shown as normally. When clicking on legend 2 all...
Read more >
Legend guide — Matplotlib 3.6.2 documentation
Controlling the legend entries# · Creating artists specifically for adding to the legend (aka. Proxy artists)# · Legend location# · Multiple legends on...
Read more >
Plotly - Legends - Tutorialspoint
Plotly - Legends, By default, Plotly chart with multiple traces shows legends ... To display, set showlegend parameter of Layout object to True....
Read more >
Python Plotly - How to customize legend? - GeeksforGeeks
Example 2: Changing order of legend. In the below code we introduce a new parameter, legend_traceorder, and initialize is to “reversed”, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found