Plots.jl mask values in heatmap

I’m trying to mask out some values of a rectangular array in a heatmap.

It seems like it should be easy using alpha…

heatmap(rand(10,10),alpha=rand(10,10) .> 0.5)

temp

But this blanks out stripes instead of individual cells. What’s going on?

Maybe you could use NaN to mask the undesirable values as a workaround?

using Plots; gr()
m = rand(10,10)
m2 = copy(m)
m2[m .> 0.5] .= NaN 
heatmap(m2)
1 Like

Thanks. I was hoping to use alpha so I could smooth the transition, but this will work in the meantime.

Please open an issue on https://github.com/JuliaPlots/Plots.jl/issues

2 Likes

Ok
https://github.com/JuliaPlots/Plots.jl/issues/3865#issue-1016626799

2 Likes