# What is the usage of "type recipes" in RecipesBase.jl & Plots.jl?

**URL:** <https://discourse.julialang.org/t/what-is-the-usage-of-type-recipes-in-recipesbase-jl-plots-jl/92985>\
**Category:** General Usage\
**Tags:** plotting, recipe\
**Created:** [January 15, 2023, 7:54am UTC](https://discourse.julialang.org/t/what-is-the-usage-of-type-recipes-in-recipesbase-jl-plots-jl/92985 "2023-01-15T07:54:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![singularitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/singularitti/32/17678_2.png) [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Post date:** [January 15, 2023, 7:54am UTC](https://discourse.julialang.org/t/what-is-the-usage-of-type-recipes-in-recipesbase-jl-plots-jl/92985/1 "2023-01-15T07:54:49Z")

</div>

The signature of a normal recipe looks like

```julia
@recipe function f(data::AbstractArray{MyType})

```

And the “type recipes”'s signature look like:

```julia
@recipe f(::Type{MyWrapper}, mw::MyWrapper) = mw.v

```

What is the difference? Why don’t we just define

```julia
@recipe f(mw::MyWrapper) = mw.v

```

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [January 15, 2023, 7:58am UTC](https://discourse.julialang.org/t/what-is-the-usage-of-type-recipes-in-recipesbase-jl-plots-jl/92985/2 "2023-01-15T07:58:30Z")

</div>

The first is a _user recipe_, it only affects calls with that specific signature. Try for instance `plot(rand(5), MyWrapper(rand(5)))`. If you have a type recipe Plots will know to transform the second argument, if you only have a user recipe you will need to make a recipe for that specific signature.
