AlgebraOfGraphics.jl
AlgebraOfGraphics.jl copied to clipboard
A simpler way to plot heatmaps with independent colorbars
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](https://user-images.githubusercontent.com/19525261/217099070-b1018a34-d994-4de1-acf3-9db4d0c24cff.png)
but,
- it will be nice if there were a simpler way to pass the data.
- each heatmap could have his own -colobar -colormap -colorrange so that we could control the appearance for different variables (a & b here).
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.