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

colorscale=- results in a black image #4883

Open
1 of 3 tasks
aplavin opened this issue Mar 21, 2025 · 5 comments · May be fixed by #4884
Open
1 of 3 tasks

colorscale=- results in a black image #4883

aplavin opened this issue Mar 21, 2025 · 5 comments · May be fixed by #4884
Labels
bug colors color, colormap, colorrange, alpha, etc

Comments

@aplavin
Copy link
Contributor

aplavin commented Mar 21, 2025

Result of image(randn(20, 20), colorscale=-) is just an empty black image:
Image
I would expect the same visual result as image(-A), with the only difference being labels for the colorbar.

  • what version of Makie are you running? (]st -m Makie) latest, v0.22.2
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie) yes
  • What platform + GPU are you on? any
@aplavin aplavin added the bug label Mar 21, 2025
@SimonDanisch
Copy link
Member

Huh, I guess the colornorm needs to get sorted after applying the colorscale:

julia> f, ax, pl = image(randn(20, 20), colorscale=-)
julia> s = display(f)
julia> robj = GLMakie.plot2robjs(s, pl)[1]
julia> robj[:color_norm][]
2-element Vec{2, Float32} with indices SOneTo(2):
  2.4661164
 -2.9072657
julia> robj[:color_norm][] = Vec2f(-3, 3)

@asinghvi17
Copy link
Member

Looks like this is an issue on CairoMakie as well:
Image

@SimonDanisch
Copy link
Member

Yeah, the code for this is in Makie.jl

@SimonDanisch
Copy link
Member

@asinghvi17
Copy link
Member

Thanks for the hint, added some calls to extrema (maybe that should be distinct_extrema_nan?) in #4884

@asinghvi17 asinghvi17 added the colors color, colormap, colorrange, alpha, etc label Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug colors color, colormap, colorrange, alpha, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants