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.

Consider removing column name and = sign in legend

See original GitHub issue

Hi again @nicolaskruchten,

Something that puzzled me about the color arg in the plot is that it includes the name of the column followed by an equal sign. Would you consider removing it and just let the value of the column in place? Here are a few reasons to support that point :

  • It is not displayed in plotly by default
  • It’s redundant information when we see date= orcountry= it easy to infer by the value of the field
  • It takes some extra place, that is valuable, especially in the vertical orientation.

image

Also, for personal taste, I think equal sign does not play well outside equations and prefer : instead.

Happy to discuss with you about it. Maybe there is an option that can disable it, that I am not aware of.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
prateekshrivastav786commented, Feb 19, 2020

If you just want to show the values in legend, you can use this:

fig = px.scatter(data_grouped_month, x="resolved_tf", y="alert_role",
                 size='incident_count',color='alert_role', hover_data=['alert_role']).for_each_trace(lambda t: t.update(name=t.name.split("=")[1]))

like if you have something like:

alert_role=cpu
alert_role=clone
alert_role=memory
alert_role=io wait time
alert_role= databse

Like: Screenshot 2020-02-19 at 12 39 27

so the below snippet will remove the “alert_role” and will show only values like cpu, clone,memory etc: .for_each_trace(lambda t: t.update(name=t.name.split("=")[1]))

The output will be:

cpu
clone
memory
io wait time
database

Screenshot 2020-02-19 at 12 31 58

11reactions
nicolaskruchtencommented, May 7, 2019

With the newest release, you can now easily change this after the fact with something like:

.for_each_trace(lambda t: t.update(name=t.name.replace("=",": ")))

For example:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove column name from legend in pandas barplot
Remove column name from legend in pandas barplot ; 'batsman','non_striker' ; sum().unstack().fillna(0) ; 'bar',stacked=True ; True) plt.legend(loc=' ...
Read more >
Show or hide a chart legend or data table - Microsoft Support
Show or hide a legend · To hide the legend, click None. Tip: To quickly remove a legend or a legend entry from...
Read more >
powerKPI legend displaying the column name - Microsoft Power BI ...
I am having issues with the powerKPI visualisation (not powerKPI matrix) legend. It is displaying the column name after the measure name. How...
Read more >
Working with legends—ArcMap | Documentation
When you use a single symbol for the features in a layer, the layer is labeled with the layer's name in the legend....
Read more >
Use multiple columns in a Matplotlib legend - GeeksforGeeks
Read; Discuss; Courses; Practice; Video. Improve Article ... Here, k is the number of columns the legend should have in the graph. Example:....
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