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

Image widget not showing. #3

Open
michiboo opened this issue Mar 10, 2019 · 1 comment
Open

Image widget not showing. #3

michiboo opened this issue Mar 10, 2019 · 1 comment

Comments

@michiboo
Copy link

Hi I was trying to show image with Ipyastroimage with input being numpy array
Input:
color_scale = bqplot.ColorScale() scale_x = bqplot.LinearScale() scale_y = bqplot.LinearScale() image = AstroImage(image=data, scales={'image': color_scale, 'x': scale_x, 'y': scale_y})

Output:
AstroImage(image=array([[ 4.1139283, 4.4903197, 4.6050134, ..., 5.6953917, 9.383944 , 10.25792 ], [ 4.670872 , 5.606509 , 5.4989924, ..., 3.6070461, 5.371789 , 6.604827 ], [ 4.3647394, 5.54057 , 6.055377 , ..., 3.5973377, 4.83896 , 6.737476 ], ..., [22.368206 , 11.044641 , 4.1607943, ..., 3.3912497, 4.3756213, 3.659427 ], [ 9.733774 , 6.5522428, 3.4279304, ..., 2.7059777, 2.4026213, 2.7714913], [ 4.641999 , 3.700842 , 3.0346284, ..., 3.0442555, 2.8392305, 3.0797014]], dtype=float32), interactions={'hover': 'tooltip'}, scales={'image': ColorScale(), 'x': LinearScale(), 'y': LinearScale()}, scales_metadata={'x': {'orientation': 'horizontal', 'dimension': 'x'}, 'y': {'orientation': 'vertical', 'dimension': 'y'}, 'image': {'dimension': 'color'}}, tooltip_style={'opacity': 0.9})

As you can see only AstroImage follow by arguments value is shown

Then I try to put it in bqplot figure by using following:
fig = bqp.Figure(marks=[image])
display(fig)

still it didn't shown anything.

If you have any idea what might the problem, please let me know.

Thanks!

@maartenbreddels
Copy link
Collaborator

This needs a special branch of bqplot, we use it with mybinder with this setup script:
https://github.com/glue-viz/glue-jupyter/blob/master/binder/setup.sh
I hope that helps.

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

No branches or pull requests

2 participants