From f35de647738bcf080bc2d710d481ffddc064c062 Mon Sep 17 00:00:00 2001 From: Nicholas Bauer Date: Wed, 25 Aug 2021 11:35:35 -0400 Subject: [PATCH] No exception thrown in `apply_recipe` fallback Throwing an exception here can vastly slow down plotting, as it happens frequently. Returning an error value instead, which the calling function can check, can speed up plotting 2x. An accompanying change is necessary in RecipesPipeline.jl, assuming this value is suitable. --- src/recipes.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recipes.jl b/src/recipes.jl index 0466d66c..d97d1f0d 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -47,7 +47,7 @@ num_series(x::AMat) = size(x, 2) num_series(x) = 1 RecipesBase.apply_recipe(plotattributes::AKW, ::Type{T}, plt::AbstractPlot) where {T} = - throw(MethodError(T, "Unmatched plot recipe: $T")) + nothing # ---------------------------------------------------------------------------