heatmap
heatmap(x, y, values)
heatmap(values)
Plots a heatmap as an image on
x, y
(defaults to interpretation as dimensions).
Attributes
Generic
-
visible::Bool = truesets whether the plot will be rendered or not. -
overdraw::Bool = falsesets whether the plot will draw over other plots. This specifically means ignoring depth checks in GL backends. -
transparency::Bool = falseadjusts how the plot deals with transparency. In GLMakietransparency = trueresults in using Order Independent Transparency. -
fxaa::Bool = trueadjusts whether the plot is rendered with fxaa (anti-aliasing). -
inspectable::Bool = truesets whether this plot should be seen byDataInspector. -
depth_shift::Float32 = 0f0adjusts the depth value of a plot after all other transformations, i.e. in clip space, where0 <= depth <= 1. This only applies to GLMakie and WGLMakie and can be used to adjust render order (like a tunable overdraw). -
model::Makie.Mat4fsets a model matrix for the plot. This replaces adjustments made withtranslate!,rotate!andscale!. -
coloris set by the plot. -
colormap::Union{Symbol, Vector{<:Colorant}} = :viridissets the colormap that is sampled for numericcolors. -
colorrange::Tuple{<:Real, <:Real}sets the values representing the start and end points ofcolormap. -
nan_color::Union{Symbol, <:Colorant} = RGBAf(0,0,0,0)sets a replacement color forcolor = NaN.
Other
-
lowclip::Union{Nothing, Symbol, <:Colorant} = nothingsets a color for any value below the colorrange. -
highclip::Union{Nothing, Symbol, <:Colorant} = nothingsets a color for any value above the colorrange. -
interpolate::Bool = falsesets whether colors should be interpolated.
Examples
Two vectors and a matrix
using CairoMakie
xs = range(0, 10, length = 25)
ys = range(0, 15, length = 25)
zs = [cos(x) * sin(y) for x in xs, y in ys]
heatmap(xs, ys, zs)
Two ranges and a function
using CairoMakie
function mandelbrot(x, y)
z = c = x + y*im
for i in 1:30.0; abs(z) > 2 && return i; z = z^2 + c; end; 0
end
heatmap(-2:0.1:1, -1.1:0.1:1.1, mandelbrot,
colormap = Reverse(:deep))
Three vectors
There must be no duplicate combinations of x and y, but it is allowed to leave out values.
using CairoMakie
xs = [1, 2, 3, 1, 2, 3, 1, 2, 3]
ys = [1, 1, 1, 2, 2, 2, 3, 3, 3]
zs = [1, 2, 3, 4, 5, 6, 7, 8, NaN]
heatmap(xs, ys, zs)
Colors
Using the previous example, we can see how to change the color of our plot. You can find additional colors here .
These docs were autogenerated using Makie: v0.16.6, GLMakie: v0.5.5, CairoMakie: v0.7.5, WGLMakie: v0.5.5