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

EXP: Add colorbar to image maybe #403

Closed
wants to merge 1 commit into from
Closed

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Oct 14, 2023

We are trying to add a colorbar for Imviz somewhere. The bqplot examples does not show that is it possible to render the colorbar separately. I tried to attach one to axes like the examples but this one does not crash but also does not show colorbar in Imviz. Need advice, @astrofrog, @maartenbreddels, or @mariobuikhuizen . 🙏

@codecov
Copy link

codecov bot commented Oct 14, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (0976a06) 86.62% compared to head (b7e379a) 86.63%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #403   +/-   ##
=======================================
  Coverage   86.62%   86.63%           
=======================================
  Files          89       89           
  Lines        5130     5131    +1     
=======================================
+ Hits         4444     4445    +1     
  Misses        686      686           
Files Coverage Δ
glue_jupyter/bqplot/image/frb_mark.py 54.68% <100.00%> (+0.71%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -38,6 +38,9 @@ def __init__(self, viewer, array_maker):
self.viewer.figure.axes[1].scale.observe(self.debounced_update, 'min')
self.viewer.figure.axes[1].scale.observe(self.debounced_update, 'max')

# Colorbar?
self.viewer.figure.axes.append(ColorAxis(scale=self.scale_image))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutating python list cannot be detected, only re-assignment, so to make bqplot see this change, you should use this:

Suggested change
self.viewer.figure.axes.append(ColorAxis(scale=self.scale_image))
self.viewer.figure.axes = [...self.viewer.figure.axes, ColorAxis(scale=self.scale_image)]

@pllim
Copy link
Contributor Author

pllim commented Oct 17, 2023

Thanks! But from the discussions this morning, looks like we do not want to use ColorScale at all, so closing.

@pllim pllim closed this Oct 17, 2023
@pllim pllim deleted the colorbar-maybe branch October 17, 2023 18:24
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

Successfully merging this pull request may close these issues.

2 participants