Discrete heatmap in Plots.jl

The following code gives me exactly what I need except that I do not want a continuous colorbar. How do I get a discrete color bar (i.e. 1 = “red”, 2 = “blue”, and 3 = “green”, etc.)?

timePeriods = 12
nodes = 15
ys = [string(“N”,i) for i in 1:nodes]
xs = [string("T ",i) for i in 1:timePeriods]
r = rand([1,2,3],nodes,timePeriods)
heatmap(xs, ys, r,yflip=true,c=ColorGradient([:red,:blue,:green]))

If I use the following code, then I get an error “MethodError: no method matching _as_gradient(::Array{RGB{Float64},1})”. This was the code used in the following GitHub issue: https://github.com/JuliaPlots/Plots.jl/issues/204.

heatmap(xs, ys, r,yflip=true,c=[:red,:blue,:green])

This page has an example of a discrete colorbar
http://docs.juliaplots.org/latest/generated/gr/#gr-ref22-1
having a look inside contour leads here
but from there I can’t really make sense out of it