Added a recipe to show a single gradient

This commit is contained in:
Michael K. Borregaard 2017-02-22 11:48:37 +01:00
parent 4b2ce036e8
commit d4b7bfbe1d

View File

@ -810,7 +810,7 @@ end
@userplot ShowLibrary
@recipe function f(cl::ShowLibrary)
if !(length(cl.args) == 1 && isa(cl.args[1], Symbol))
error("ShowLibrary takes the name of a color library as a Symbol")
error("showlibrary takes the name of a color library as a Symbol")
end
library = clibrary(cl.args[1])
@ -832,3 +832,17 @@ end
end
end
end
@userplot ShowGradient
@recipe function f(grad::ShowGradient)
if !(length(grad.args) == 1 && isa(grad.args[1], Symbol))
error("showgradient takes the name of a color gradient as a Symbol")
end
z = sqrt.((1:15)*(1:20)')
seriestype := :heatmap
ticks := nothing
legend := false
seriescolor := grad.args[1]
title := grad.args[1]
z
end