Heatmaps
AsyPlots.PixelMap
— Type.PixelMap(pixels, lowerleft, upperright; kwargs...)
A graphics primitive representing a two-dimensional array of pixels situated in the box with given lower left and upper right corners.
pixels
is an array of NamedColor
s, while lowerleft
and upperright
are tuples.
Examples
julia> pixels = [x*NamedColor("blue") +
(1-x)*NamedColor("red")
for x in 0:0.1:1, y in 0:0.1:1]
julia> PixelMap(pixels, (0,0), (1,1))
PixelMap(<11×11>,[0,1]×[0,1])
AsyPlots.heatmap
— Function.heatmap(A; colors)
heatmap(A, lowerleft, upperright; colors)
heatmap(xs, ys, f::Function)
Plot a heatmap of the values stored in the matrix A
, using the colormap represented by the vector colors
of NamedColors
. Place the resulting PixelMap
according to the given lowerleft
and upperright
tuples (which default to (0,0) and size(A)).
Examples
julia> heatmap(0:10, 0:10, (x,y) -> x^2 + y^2)
heatmap(1:10, 1:10, (x,y) -> x^2 + y^2, smooth = true)