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

custom colorscale support #3088

Closed
1 task done
t-bltg opened this issue Jul 24, 2023 · 3 comments · Fixed by #3095
Closed
1 task done

custom colorscale support #3088

t-bltg opened this issue Jul 24, 2023 · 3 comments · Fixed by #3095

Comments

@t-bltg
Copy link
Collaborator

t-bltg commented Jul 24, 2023

#2900 / #2493 which landed in 0.19.7 introduced some subtle bugs, where it seems that the colorscale is applied multiple times in the pipeline (resulting in multiple values overlapping on the colorbar).

EDIT: this is related to the inverse transform of custom colorscales.

I still have to come up with an mwe, because my example is complicated.

overlap

Currently observed on CairoMakie (other backends un-tested).

  • are you running newest version (version from docs) ?
@t-bltg t-bltg added the bug label Jul 24, 2023
@t-bltg
Copy link
Collaborator Author

t-bltg commented Jul 25, 2023

Here is a mwe, occurs when using a custom colorscale:

using CairoMakie

main() = begin
  xs = range(0, 2π, length=100)
  ys = range(0, 2π, length=100)
  zs = [sin(x*y) for x  xs, y  ys]

  fig, ax, hm = heatmap(
    xs, ys, zs; colorscale=x -> log10(1 + x)
  )
  Colorbar(fig[2, 1], hm; vertical=false, flipaxis=false)

  display(fig)
  save("colorscale.png", fig; px_per_unit=2)
  return
end

main()

We need IMO some mechanism to register a custom inversible colorscale.

@t-bltg t-bltg changed the title colorscale applied multiple times custom colorscale support Jul 25, 2023
@SimonDanisch
Copy link
Member

I think we're re-using parts of the Axis infrastructure, so maybe this helps #3089?

@t-bltg
Copy link
Collaborator Author

t-bltg commented Jul 26, 2023

Thanks for the reference.

I think the solution implemented in #3095 is generic (works for axis scale, but also for colorscale) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants