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

A simpler way to plot heatmaps with independent colorbars #444

Closed
lazarusA opened this issue Feb 6, 2023 · 2 comments
Closed

A simpler way to plot heatmaps with independent colorbars #444

lazarusA opened this issue Feb 6, 2023 · 2 comments

Comments

@lazarusA
Copy link

lazarusA commented Feb 6, 2023

The following kinda works?

using GLMakie, DataFrames, AlgebraOfGraphics
df = DataFrame(;
    x = repeat(repeat(1:10, inner=10), outer =2),
    y = repeat(repeat(1:10, outer =10), outer =2),
    val= rand(200),
    l = [fill("a", 100)..., fill("b",100)...])

data(df) * mapping(:x, :y, :val, layout=:l) * visual(Heatmap) |> draw

Screenshot 2023-02-06 at 23 10 49

but,

  1. it will be nice if there were a simpler way to pass the data.
  2. each heatmap could have his own
    -colobar
    -colormap
    -colorrange
    so that we could control the appearance for different variables (a & b here).
@mscott99
Copy link

mscott99 commented Feb 9, 2023

Thanks for that code, I was trying to figure out how to display a heatmap from a 2d array.

I agree with the issue, it would be nice to have Matrix elements in a dataframe that can be processed to a heatmap, since the heatmap function can take them as arguments.

It seems to me that a single colorbar is preferable by default.

@jkrumbiegel
Copy link
Member

Closing the specific request for independent color bars for different values of a grouping variable as not planned. The new scales system would allow you two use different color scales if you had different factors, but there isn't support for adding those multiple colorbars yet (that's a different issue, though).

@jkrumbiegel jkrumbiegel closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
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

3 participants