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.

BQPlot 0.12.12 Stacked bar opacities set on a group level and not individual bars

See original GitHub issue

Hi team,

There’s a change in behaviour between bqplot 0.11.6 and 0.12.12 where setting opacities for a stacked bar plot applies the opacities on the entire bar group (all layers) in version 0.12.12, as opposed to each individual bar layer in 0.11.6. The expected behaviour is that of 0.11.6. See the code below to reproduce:

from bqplot import OrdinalScale, LinearScale, Bars, Axis, Figure

x_ord = OrdinalScale()
y_sc = LinearScale()

bar = Bars(x=[0, 1], y=[[1.5, 1.5], [2.5, 2.5], [3.5, 3.5]], 
           scales={'x': x_ord, 'y': y_sc}, 
           labels=['Dim 1', 'Dim 2', 'Dim 3'], display_legend=True, opacities=[1, 0.7, 0.1, 0.1, 0.7, 1])
ax_x = Axis(scale=x_ord)
ax_y = Axis(scale=y_sc, orientation='vertical')

Figure(marks=[bar], axes=[ax_x, ax_y])

This is a screenshot from version 0.11.6, with the expected behaviour: image

That is a screenshot from 0.12.12, where opacities are applied group-wise: image

Many thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

ibdafnacommented, Jun 25, 2020

I think that makes sense. We can also use “no_group” to say we’re not applying any sort of grouping logic. I’m okay with either! Feel free to make the call 😃

martinRenoucommented, Jun 26, 2020

I updated my PR. Please tell me what you think 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

bqplot.marks.Bars - Read the Docs
Specifies whether the bar chart is drawn horizontally or vertically. If a horizontal bar chart is drawn, the x data is drawn vertically....
Read more >
Bqplot rendering new bar at each step in animation instead of ...
Here is a way of making the 'bars' animate nicely in x. It can't be done with bars. Instead I've used line marks...
Read more >
bqplot - Interactive Plotting in Python Jupyter Notebook
All of the individual components of the graph in bqplot are interactive widgets based on ipywidgets. This gives a lot of flexibility with ......
Read more >
bqplot - PyPI
bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar ... In bqplot, every component of a plot...
Read more >
Interactive Data Visualization Using Bqplot - Analytics Vidhya
For constructing plots, bqplot supports two types of APIs: Matplotlib pyplot-like API: It has the same set of methods which matplotlib.pyplot ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found