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

nan_color does not work for GLMakie.image #1230

Closed
MariusDrulea opened this issue Aug 18, 2021 · 4 comments
Closed

nan_color does not work for GLMakie.image #1230

MariusDrulea opened this issue Aug 18, 2021 · 4 comments

Comments

@MariusDrulea
Copy link
Contributor

MariusDrulea commented Aug 18, 2021

I have a matrix "x" containing floating point values. It also contains invalid values, all set to NaN. According to documentation of GLMakie.image, there is this nan_color atribute. By default the NaN values are rendered fully transparent when displayed. However, this does not work. I am using GLMakie 0.4.0.

x = rand(50, 50)
x[15:25, :] .= NaN
image(x)

image

If I try heatmap(x) instead, then yes, I do get the desired transparency.
image

@MariusDrulea
Copy link
Contributor Author

Update: NaN were initially displayed as black, but now the same code gives an error:

x = rand(50, 50)
x[15:25, :] .= NaN
image(x)
Error showing value of type Makie.FigureAxisPlot:
ERROR: Looking up a non-finite or NaN value in a colormap is undefined.

@SimonDanisch
Copy link
Member

What backend is this?

@MariusDrulea
Copy link
Contributor Author

It's GLMakie

@MariusDrulea
Copy link
Contributor Author

Just tested today with the 0.16.5 release and NaN are rendered transparent by image(). nan_color property also works.
@SimonDanisch thanks :)

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