From d4b7bfbe1dab2d6705d7ce5b709848fde6f2f05f Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Wed, 22 Feb 2017 11:48:37 +0100 Subject: [PATCH] Added a recipe to show a single gradient --- src/recipes.jl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/recipes.jl b/src/recipes.jl index fb452561..152752a3 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -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