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.

Hiding the legend for a channel

See original GitHub issue

In vega-lite JSON, under encoding I was able to do the following:

"opacity": {
  "field": "positives",
  "type": "quantitative",
  "legend": false
}

The "legend": false line suppressed the rendering of the opacity legend.

In altair, I tried specifying the following argument for .encode():

opacity = altair.Opacity('positives', legend=False)

This raised the error:

TraitError: The 'legend' trait of an Opacity instance must be a Legend or None, but a value of class 'bool' (i.e. False) was specified.

Any way to hide the legend for a channel in altair?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jakevdpcommented, May 1, 2018

In Altair 2.0, this can be done with legend=None.

2reactions
jakevdpcommented, Apr 19, 2017

Altair doesn’t yet support explicit nulls, so now that they have meaning in Vega-Lite we will need to add that. I’d probably opt to introduce an altair.null object for cases like this when the user wants to be explicit (currently None tells Altair to leave that entry out of the schema, and there’s no easy way to change that behavior).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show or hide a chart legend or data table - Microsoft Support
Select a chart and then select the plus sign to the top right. Point to Legend and select the arrow next to it....
Read more >
Remove Legend in ggplot2 (3 Example Codes) - Statistics Globe
How to remove legends in ggplot2 - 3 R programming examples - Switch off one legend or hide all legends of plot -...
Read more >
Tv Settings; Favorite; Show / Hide; Channel Label - Legend ...
Legend LE2622 Manual Online: tv settings, Favorite, Show / Hide, Channel Label. Added Or Deleted From Your List. Press Enter To Add Or...
Read more >
Hiding items in highchart legend - Stack Overflow
If you want to hide the series from the legend when the chart is initialized, it is as you have written: series: {...
Read more >
can we hide legend labels - Microsoft Power BI Community
Appreciate your Kudos !! Proud to be a Super User! !! Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my...
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